adafruit / Adafruit_WICED_Arduino

Adafruit WICED Feather Arduino BSP
https://www.adafruit.com/products/3056
27 stars 19 forks source link

Update sdep function references #13

Closed microbuilder closed 8 years ago

microbuilder commented 8 years ago

Summary

There are a bunch of older sdep_n and sdep function calls using the old convention of:

FEATHERLIB->sdep_execute_n

These should be updated to sdep_n and sdep now that adafruit_wifi.cpp/h inherits from adafruit_sdep.h

The return type for the SDEP functions has also been changed from err_t to bool so the following logic will need to be updated at the same time:

err_t error = FEATHERLIB->sdep_execute_n(SDEP_CMD_CONNECT,
                                         sizeof(para_arr)/sizeof(sdep_cmd_para_t), para_arr,
                                         NULL, NULL);

The error will need to be detected and handled like this:

bool success = sdep_n(SDEP_CMD_CONNECT,
                      sizeof(para_arr)/sizeof(sdep_cmd_para_t), para_arr,
                      NULL, NULL);
return success;

If a function returns err_t the error code will need to be read (based on the success bool state) via an in-function .errno() call.

Unfortunately, this will also mean retesting all the examples to make sure they work with the updated signature. :(

File List

The following files need to be reviewed and updated: