NordicPlayground / nRF51-ble-bcast-mesh

Other
324 stars 121 forks source link

Strange code in transport_control.c #80

Closed victorpasse closed 8 years ago

victorpasse commented 8 years ago

int16_t delta = vh_get_version_delta(p_mesh_adv_data->handle, p_mesh_adv_data->version);

This makes no sense, p_mesh_adv_data->handle has nothing to do with the old version. Is this a mistake or am I confused?

victorpasse commented 8 years ago

I would suggest editing vh_get_version_delta such that it takes an handle and a new version as there are some static functions in version handler C file that extracts version from handle that can still be static.

trond-snekvik commented 8 years ago

This is a mistake, you're correct. I think the cleanest fix is to add a return-by-pointer argument to the vh_rx_register(p_mesh_adv_data, timestamp) call right below it, as it calculates the delta anyway.