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

Problem with instruction

Hello, I am trying to follow the instruction for a 2way communication between nRF chip and the client device (cell phone). Although my chip is nRF51422/ PCA10028, I have found this doument that belongs to nRF51822/ PCA10008 series. So far I have been able to configure some minor changes and make it work for nRF51422 but I am stock on page 19 whuch you can see beloow.please ignore the 500 mark :) image description

I do as instructed but get the following errors: image description

Even if I move down the ble_lbs_s I will still get errors.image description

I have redone the instructions over and over but nothing changes. Any Ideas? Thanks

Parents
  • Hi.

    The solution is to forward declare the ble_lbs_t first.

    // Forward declaration of the ble_lbs_t type.

    typedef struct ble_lbs_s ble_lbs_t;

    // declare the write handler

    typedef void (*ble_lbs_led_write_handler_t) (ble_lbs_t * p_lbs, uint8_t new_state);

    // declare the ble_lbs_s struct

    struct ble_lbs_s { variable1 name1; variable2 name2; .... };

    You can see examples of this in other example projects inside the sdk. For example in the file "ble_hrs.h" inside the "ble_app_hrs" peripheral example project.ble_hrs.h

Reply
  • Hi.

    The solution is to forward declare the ble_lbs_t first.

    // Forward declaration of the ble_lbs_t type.

    typedef struct ble_lbs_s ble_lbs_t;

    // declare the write handler

    typedef void (*ble_lbs_led_write_handler_t) (ble_lbs_t * p_lbs, uint8_t new_state);

    // declare the ble_lbs_s struct

    struct ble_lbs_s { variable1 name1; variable2 name2; .... };

    You can see examples of this in other example projects inside the sdk. For example in the file "ble_hrs.h" inside the "ble_app_hrs" peripheral example project.ble_hrs.h

Children
No Data
Related