- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone!
I am working with the whitelist example from the 100 projects list.
I wanted to take it a step further and via code have an address already in the whitelist.
So in the beginning of main.c I've added the definition for MasterFob as follows:
//Structure containing address of device
CYBLE_GAP_BD_ADDR_T whitelistdeviceaddress;
CYBLE_GAP_BD_ADDR_T MasterFob;
Then in the main() when initizing variables I tryed to do this:
MasterFob = 0x00A050022629;
I get an error here about trying to assign type "CYBLE_GAP_BD_ADDR_T" from type 'long long int'
Can someone tell me the correct way of doing this?
Afterwards, I plan on adding:
CyBle_GapAddDeviceToWhiteList(&MasterFob);
This I think will get my device into the list.
All help is appreciated!
Dan
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CYBLE_GAP_BD_ADDR_T is a pointer, so try
MasterFob = (CYBLE_GAP_BD_ADDR_T *) MasterTemp;
I didn't dig deep into the whitelist definition, so easiest will be to search in project for "CYBLE_GAP_BD_ADDR_T"
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you already try a type cast?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Bob!
Thanks for getting back to me!
So I tried:
MasterFob = (CYBLE_GAP_BD_ADDR_T) 0x00A050022629;
And I got an error about 'used type 'CYBLE_GAP_BD_ADDR_T' where arithmetic or pointer type is required.'
I also tried:
MasterTemp = 0x00A050022629; // Defined as type long long
MasterFob = (CYBLE_GAP_BD_ADDR_T) MasterTemp;
And got same error.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CYBLE_GAP_BD_ADDR_T is a pointer, so try
MasterFob = (CYBLE_GAP_BD_ADDR_T *) MasterTemp;
I didn't dig deep into the whitelist definition, so easiest will be to search in project for "CYBLE_GAP_BD_ADDR_T"
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CYBLE_GAP_BD_ADDR_T MasterFob;
long long MasterTemp = 0x00A050022629;
MasterFob=(CYBLE_GAP_BD_ADDR_T*)MasterTemp;
Error Too.
How do it correctly ?
Thanks !!