cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG return/error codes?

pasaamaster
Associate II
Posted on August 29, 2016 at 15:09

Hi.

I`m implementing BlueNRG based Eddystone beacon. And i have to check GATT Return/Error codes of GATT read/write commands in Android/iOS application.

I have no idea about this codes and i found no BueNRG API function to return them.

This codes described there (bottom of the page):

https://github.com/google/eddystone/tree/master/configuration-service

And here (Summary->Constants):

https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html

As we can see, this is the same codes.

How can i manage them manually?

Or is it an internal BLE stack implementation?

Or is it not implemented?

Thanks

Alex

#bluenrg #bluenrg #bluenrg-ble-gatt
4 REPLIES 4
Posted on August 31, 2016 at 17:10

Dear Customer,

I'm apologize but I don't understand your questions. Could you explain them again?

thanks

regards,

GM

pasaamaster
Associate II
Posted on September 22, 2016 at 12:51

Hi.

Sorry for

my

delay in answering

the question

.

I will explain.

All BLE service characteristics have some attributes and permissions (Readable, Writeable etc.). And all operations with GATT returns some operation status codes.

For example:

- When you try to write to GATT characteristics that have no Write permission BLE API returns operation status -> ''Write Not Permitted'' (code 0x03) instead of ''Operation Success'' (0x00 code).

- When you try to read from Gatt Characteristics without Read Permission you will get error ''Read Not Permitted''.

- When you try to write 10 bytes to GATT characteristics with length 8 you will get error ''Invalid Attribute Length'' (0x0D)

 - And so on

All such errors returns directly from GATT service in BlueNRG chip and user application can`t control this.

In Eddystone GATT service (described on GitHub) i must manually answer error code ''Invalid Attribute Length'' when i try to write wrong ActiveSLot value. For example after writting of value 4 when device have only 3 slots GATT stack must return error code 0x0D.

How can i do this?

pasaamaster
Associate II
Posted on September 22, 2016 at 13:02

P.S.

Now i can write every value to the GATT characteristics that have Write Permission without any error.

Application will check received value and can fix it and update Char if it will be wrong.

And for checking i must to read written value to validate operation status.

But true Eddystone protocol must get error code ''Invalid Attribute Length'' directly after Write operation.

pasaamaster
Associate II
Posted on September 22, 2016 at 13:12

P.S. I`m sorry for misunderstanding.

I means CharacteristicsProperties when i said Permissions.

Questions was about CharProperties, not about SecurityPermissions.