This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Where to use lib_aci_set_local_data

Hello Nordic Team, i've get my things working and i figured out how i can set service data and to display it in nRF Master Control.

Now i want to CHANGE my service data every 5 seconds for example.

Till now, i've used lib_aci_set_local_data like it is set in BLE-Broadcast example (maybe you open this sketch and see) within part: case ACI_DEVICE_STANDBY:

I tried to use it outside the switch-case, but then i get "You're in a while(1) loop" with ACI D message.

As long as i set it within case ACI_DEVICE_STANDBY: it is working for the first set of data, but then never changes.

How and where do i have to set local data without getting this while(1) error?

Noone here to help?

Parents
  • Hi Runar, in services.h it looks like this:

     /* Service: Gap - Characteristic: Device name - Pipe: SET */
    #define PIPE_GAP_DEVICE_NAME_SET          1
    #define PIPE_GAP_DEVICE_NAME_SET_MAX_SIZE 2
    
    /* Service: GPS_info - Characteristic: GPSsend - Pipe: BROADCAST */
    #define PIPE_GPS_INFO_GPSSEND_BROADCAST          2
    #define PIPE_GPS_INFO_GPSSEND_BROADCAST_MAX_SIZE 16
    

    And in my sketch, within the case-part i use:

    case ACI_DEVICE_STANDBY:
                
                // Open advertising pipe on pipe 2
                
                lib_aci_open_adv_pipe(2);
                // Start broadcasting
                lib_aci_broadcast(0x1000, 0x1000);
                lib_aci_set_local_data(&aci_state, 2,(uint8_t *) &Nummer1, sizeof(Nummer1)); // 
                break;
    

    Cut setlocaldata in this part and cory it outside all case-statements will cause ACI D Err

Reply
  • Hi Runar, in services.h it looks like this:

     /* Service: Gap - Characteristic: Device name - Pipe: SET */
    #define PIPE_GAP_DEVICE_NAME_SET          1
    #define PIPE_GAP_DEVICE_NAME_SET_MAX_SIZE 2
    
    /* Service: GPS_info - Characteristic: GPSsend - Pipe: BROADCAST */
    #define PIPE_GPS_INFO_GPSSEND_BROADCAST          2
    #define PIPE_GPS_INFO_GPSSEND_BROADCAST_MAX_SIZE 16
    

    And in my sketch, within the case-part i use:

    case ACI_DEVICE_STANDBY:
                
                // Open advertising pipe on pipe 2
                
                lib_aci_open_adv_pipe(2);
                // Start broadcasting
                lib_aci_broadcast(0x1000, 0x1000);
                lib_aci_set_local_data(&aci_state, 2,(uint8_t *) &Nummer1, sizeof(Nummer1)); // 
                break;
    

    Cut setlocaldata in this part and cory it outside all case-statements will cause ACI D Err

Children
No Data
Related