How to use CYBLE_GAP_ADDR_TYPE_PUBLIC and CYBLE_GAP_PUBLIC_ADDR?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
IvBu_1817031
Level 2
Level 2
First like received

There are two definitions with similar names but different values in CyBle_StackGap.h - CYBLE_GAP_ADDR_TYPE_PUBLIC (value 0), and CYBLE_GAP_PUBLIC_ADDR. (value 2). The structure CYBLE_GAP_BD_ADDR_T also has a field named type, which should be 0 for a public address and 1 for a random one.

I would like to clarify how I can correctly use those definitions - when or where is each one of them intended to be used?

0 Likes
1 Solution
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

>>"I would like to clarify how I can correctly use those definitions - when or where is each one of them intended to be used?"

--> The enumerated type CYBLE_GAP_PUBLIC_ADDR is a part of the enum variable CYBLE_GAP_ADDR_TYPE_T. The usage of this enum variable is only associated with the API CyBle_GapGenerateDeviceAddress().

--> Where as  CYBLE_GAP_BD_ADDR_T is a structure that stores the 6 byte address as well as the type of the address (primarily public or random).

So there is no need to get confused. Please go through the API definition, description and use the corresponding enumerator/structure accordingly.

Hope this helps !

Thanks

Ganesh

View solution in original post

0 Likes
2 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

>>"I would like to clarify how I can correctly use those definitions - when or where is each one of them intended to be used?"

--> The enumerated type CYBLE_GAP_PUBLIC_ADDR is a part of the enum variable CYBLE_GAP_ADDR_TYPE_T. The usage of this enum variable is only associated with the API CyBle_GapGenerateDeviceAddress().

--> Where as  CYBLE_GAP_BD_ADDR_T is a structure that stores the 6 byte address as well as the type of the address (primarily public or random).

So there is no need to get confused. Please go through the API definition, description and use the corresponding enumerator/structure accordingly.

Hope this helps !

Thanks

Ganesh

0 Likes

Thank you, Ganesh!  For me, the confusion came naturally - I was in a hurry, but It's clear now. 

Regards!

0 Likes