cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Contributor

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

0 Likes
Reply
1 Solution
Esteemed Contributor II

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

View solution in original post

0 Likes
Reply
4 Replies
Esteemed Contributor II

Did you already try a type cast?

   

 

   

Bob

0 Likes
Reply
Contributor

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

0 Likes
Reply
Esteemed Contributor II

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

View solution in original post

0 Likes
Reply
Anonymous
Not applicable

CYBLE_GAP_BD_ADDR_T     MasterFob;

   

long long MasterTemp = 0x00A050022629;
MasterFob=(CYBLE_GAP_BD_ADDR_T*)MasterTemp;

   

Error Too. 

   

How do it correctly ?

   

Thanks !!

0 Likes
Reply