-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples: bluetooth: OpenDroneID #84565
base: main
Are you sure you want to change the base?
Conversation
This application demonstrates ODID Message transmission over Bluetooth in GAP Broadcaster role. Currently this program supports transmitting static drone data via Bluetooth Beacon. Co-authored-by: Mayank Mahajan <[email protected]> Signed-off-by: Sumit Batra <[email protected]>
8a5197b
to
6d9c1b4
Compare
* | ||
* @param data (non encoded/packed) structure | ||
*/ | ||
void odid_initLocationData(ODID_Location_data *data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snake case required
static struct ODID_UAS_Data uasData; | ||
static union ODID_Message_encoded encoded; | ||
static uint8_t msg_counters[ODID_MSG_COUNTER_AMOUNT]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declare at top of file, in snake case
|
||
uasData->BasicID[BASIC_ID_POS_ONE].UAType = ODID_UATYPE_HELICOPTER_OR_MULTIROTOR; | ||
uasData->BasicID[BASIC_ID_POS_ONE].IDType = ODID_IDTYPE_SPECIFIC_SESSION_ID; | ||
char uas_caa_id[] = "FD3454B778E565C24B70"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declare variables at top
I'm wondering if this code belongs in the folder |
I would request all the reviewers to kindly review this PR despite of the LLVM/Twister errors since these errors cannot be resolved till PR #82034 is merged |
while (true) { | ||
if (bt_is_ready()) { | ||
break; | ||
} | ||
|
||
printf("Bluetooth not ready. Checking again in 100 ms\n"); | ||
k_sleep(K_MSEC(100)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does't look particularly elegant. You could instead have this wait on a semaphore that your bt_ready()
callback eventually gives, however the bt_enable()
API already has support for blocking behavior: you just need to pass NULL to it, and then do the stuff you do in your bt_ready()
right here in main()
|
||
update_payload(turn); | ||
|
||
static const struct bt_data ad_new[] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need this new ad_new
? Can't you just reuse the top-level ad
?
This application demonstrates ODID Message transmission over Bluetooth in GAP Broadcaster role. Currently this program supports transmitting static drone data via Bluetooth Beacon.
OpendroneID application can be used with the SoC and the Board support added in
PR #82034