SWRA772 august 2023 CC2564C
The following function is responsible for registering a SPPLE Service. This function returns zero on successful execution and a negative value on errors.
Including parameters is not necessary when using this command. A parameter has no effect on the outcome of registering a SPPLE Service.
GATT_Register_Service(BluetoothStackID, SPPLE_SERVICE_FLAGS, SPPLE_SERVICE_ATTRIBUTE_COUNT, (GATT_Service_Attribute_Entry_t *)SPPLE_Service,&ServiceHandleGroup, GATT_ServerEventCallback, 0)
int BTPSAPI GATT_Register_Service(unsigned int BluetoothStackID, Byte_t ServiceFlags, unsigned int NumberOfServiceAttributeEntries, GATT_Service_Attribute_Entry_t*ServiceTable, GATT_Attribute_Handle_Group_t *ServiceHandleGroupResult, GATT_Server_Event_Callback_t ServerEventCallback, unsigned long CallbackParameter)
The following function is provided to allow a means to add a GATT Service to the local GATT Database. The first parameter is Bluetooth stack ID of the Bluetooth Device. The second parameter is a bit mask field that specifies the type of service being registered, which must be non-zero (i.e. at least one bit must be set). The third parameter is the number of entries in the service attribute array that is pointed to by the fourth parameter. The fourth parameter is an array that contains the attributes for the service being registered. The next parameter is a pointer to a buffer that stores the attribute handle range of the registered service. The final two parameters specify the GATT server callback and callback parameter that can be used whenever a client request to the GATT server cannot be satisified internally by the local GATT module. This function returns a positive non-zero service ID if successful, or a negative return error code if there is an error. If this function returns successfully then the ServiceHandleGroupResult buffer contains the service's attribute handle range.