I'm building a BLE automation IO card, so I'm trying to use BLE-Automation I/O https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.automation_io.xml
And it says that it supports 1 or more Analog (0x2a58) or Digital Attributes (0x2a56)... so I created a whole list of analog and digital attributes:
Digital - "Output energized" [RO]
Analog - "Current Temp" [RO]
Digital - "Self-test" [RW]
Digital - "Self-test results" [RO]
Analog - "Temp setpoint" [RW]
-- but, since they are the BLE SIG attributes, they're all coming up with the same UUID and it's confusing the client software.
Should I make them "custom" with my own 128 bit UUID's or is there an "index" or somesuch field that I should use to serialize them properly?
I'm using the BlueNRG1 chip, and the code I'm currently using is
suuid.Service_UUID_16 = 0x1815; //Automation
ret = aci_gatt_add_service(UUID_TYPE_16, &suuid, PRIMARY_SERVICE, 35, &AutomationHandle);
if (ret != BLE_STATUS_SUCCESS) {PRINTF("j"); goto fail;}
cuuid.Char_UUID_16=0x2A56; //[0]Digital: Bar Detected
ret = aci_gatt_add_char(AutomationHandle, UUID_TYPE_16, &cuuid, 1, CHAR_PROP_READ, ATTR_PERMISSION_NONE, GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, 16, CHAR_VALUE_LEN_CONSTANT, &OutCharHandle);
if (ret != BLE_STATUS_SUCCESS) {PRINTF("k"); goto fail;}
cuuid.Char_UUID_16= 0x2A58; //[1]Analog: Current Temp
ret = aci_gatt_add_char(AutomationHandle, UUID_TYPE_16, &cuuid, 2, CHAR_PROP_READ, ATTR_PERMISSION_NONE, GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, 16, CHAR_VALUE_LEN_CONSTANT, &CurDetectCharHandle);
if (ret != BLE_STATUS_SUCCESS) {PRINTF("l"); goto fail;}
ApplyFormat_Temp16(AutomationHandle,CurDetectCharHandle);
cuuid.Char_UUID_16= 0x2A58; //[2]Analog: BarCount
ret = aci_gatt_add_char(AutomationHandle, UUID_TYPE_16, &cuuid, 2, CHAR_PROP_READ | CHAR_PROP_WRITE | GATT_NOTIFY_ATTRIBUTE_WRITE , ATTR_PERMISSION_NONE, GATT_NOTIFY_WRITE_REQ_AND_WAIT_FOR_APPL_RESP | GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, 16, CHAR_VALUE_LEN_CONSTANT, &LastbarcountCharHandle);
if (ret != BLE_STATUS_SUCCESS) {PRINTF("r"); goto fail;}
cuuid.Char_UUID_16= 0x2A58; //[3]Analog: Last Bar Temp
ret = aci_gatt_add_char(AutomationHandle, UUID_TYPE_16, &cuuid, 2, CHAR_PROP_READ, ATTR_PERMISSION_NONE, GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, 16, CHAR_VALUE_LEN_CONSTANT, &LastbartempCharHandle);
cuuid.Char_UUID_16= 0x2A56; //[5]Digital: Self Test
ret = aci_gatt_add_char(AutomationHandle, UUID_TYPE_16, &cuuid, 1, CHAR_PROP_READ | CHAR_PROP_WRITE | GATT_NOTIFY_ATTRIBUTE_WRITE , ATTR_PERMISSION_NONE, GATT_NOTIFY_WRITE_REQ_AND_WAIT_FOR_APPL_RESP | GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP,
16, CHAR_VALUE_LEN_CONSTANT, &SelftestCharHandle);
if (ret != BLE_STATUS_SUCCESS) {PRINTF("o"); goto fail;}
cuuid.Char_UUID_16= 0x2A56; //[6]Digital: Self Test Passed
ret = aci_gatt_add_char(AutomationHandle, UUID_TYPE_16, &cuuid, 1, CHAR_PROP_READ | CHAR_PROP_WRITE | GATT_NOTIFY_ATTRIBUTE_WRITE , ATTR_PERMISSION_NONE, GATT_NOTIFY_WRITE_REQ_AND_WAIT_FOR_APPL_RESP | GATT_NOTIFY_READ_REQ_AND_WAIT_FOR_APPL_RESP, 16, CHAR_VALUE_LEN_CONSTANT, &STpassedCharHandle);
if (ret != BLE_STATUS_SUCCESS) {PRINTF("p"); goto fail;}
...
I do see them in the app, but they all have the same UUID so the app is not seeing the differences in the access permissions.