From 348232a66339238f145e608df65f494b9ee6b692 Mon Sep 17 00:00:00 2001 From: Gregg Date: Sat, 20 Jan 2024 16:43:17 -0600 Subject: [PATCH] update --- src/Span.h | 7 +-- tools/makeServiceList | 105 ++++++++++++++++++------------------------ tools/test.md | 2 +- 3 files changed, 46 insertions(+), 68 deletions(-) diff --git a/src/Span.h b/src/Span.h index b6f5b3d..a39141f 100644 --- a/src/Span.h +++ b/src/Span.h @@ -40,7 +40,7 @@ namespace Service { - CREATE_SERV(AccessoryInformation,3E) + CREATE_SERV(AccessoryInformation,3E) // Required Identification Information. For each Accessory in a HomeSpan device this must be included as the first Service. REQ(Identify); OPT(FirmwareRevision); OPT(Manufacturer); @@ -51,11 +51,6 @@ namespace Service { OPT(AccessoryFlags); END_SERV -//! Here is some important text you need to read. -//! Spacing is not critical since this will be -//! formated in HTML where spaces are ignored. -//! You can use *standard* markdown elements as well. - CREATE_SERV(AirPurifier,BB) REQ(Active); REQ(CurrentAirPurifierState); diff --git a/tools/makeServiceList b/tools/makeServiceList index 220abc1..67ef5a9 100755 --- a/tools/makeServiceList +++ b/tools/makeServiceList @@ -2,77 +2,60 @@ BEGIN { - servicesFile = "../src/Span.h" - charsFile = "../src/Characteristics.h" + ws="[ \t,();]+" # regexp of separators + ltws="^" ws "|" ws "$" # regexp of leading and trailing separators - ws="[ \t,();]+" # regexp of separators - ltws="^" ws "|" ws "$" # regexp of leading and trailing separators + nServs=0 # number of Services found +} - nServs=0 +{ + split($0,line,"//") # separate line into program and (optional) comment + gsub(ltws,"",line[1]) # strip out leading or trailing separators - while(getline < servicesFile ){ - - split($0,line,"//") - - gsub(ltws,"",line[1]) # strip out leading or trailing separators - - if(index($0,"//!")==1){ - desc[currentService]=desc[currentService] " " substr($0,4) - continue - } - - n=split(line[1],x,ws) - - if(x[1]=="CREATE_SERV"){ - currentService=x[2] - services[nServs++]=currentService - uuid[currentService]=x[3] - nChars[currentService]=0 - } - - else if(x[1]=="REQ" || x[1]=="OPT"){ - servChars[currentService,nChars[currentService]]=x[2] - servReq[currentService,nChars[currentService]]=(x[1]=="REQ") - nChars[currentService]++ - } - - else if(x[1]=="CREATE_CHAR"){ - char=x[3] - default[char]=x[4] - min[char]=x[5] - max[char]=x[6] - nVals[char]=n-6 # number of pre-defined constants - for(i=0;i%s
\n",desc[s]) printf("\n") + for(j=0;j") @@ -93,9 +76,9 @@ BEGIN { printf("") printf("",notes[char]) } + printf("
CharacteristicUUIDFormatPermsMinMaxConstantsNotes
%s
\n\n") } - } diff --git a/tools/test.md b/tools/test.md index 6c102b4..24c49ae 100644 --- a/tools/test.md +++ b/tools/test.md @@ -1,5 +1,5 @@ ## AccessoryInformation (3E) -
Here is some important text you need to read. Spacing is not critical since this will be formated in HTML where spaces are ignored. You can use *standard* markdown elements as well.
+
Required Identification Information. For each Accessory in a HomeSpan device this must be included as the first Service.
CharacteristicUUIDFormatPermsMinMaxConstantsNotes
Identify14boolPW01
    FirmwareRevision52stringPR+EV--
      Manufacturer20stringPR--
        Model21stringPR--
          Name23stringPR--
            SerialNumber30stringPR--
              HardwareRevision53stringPR--
                AccessoryFlagsA6uint32PR+EV11
                  This is not really used anywhere 1/3