Skip to content

Commit

Permalink
Fix builds after #2503
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Jun 17, 2024
1 parent 51baa11 commit ed56105
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libs/banglejs/jswrap_bangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -3956,7 +3956,7 @@ NO_INLINE void jswrap_banglejs_init() {
h = (int)(unsigned char)jsvGetCharInString(img, 1);
char addrStr[20];
#ifndef EMULATED
JsVar *addr = jswrap_ble_getAddress(); // Write MAC address in bottom right
JsVar *addr = jswrap_ble_getAddress(false); // Write MAC address in bottom right
#else
JsVar *addr = jsvNewFromString("Emulated");
#endif
Expand All @@ -3977,7 +3977,7 @@ NO_INLINE void jswrap_banglejs_init() {
else y += h-15;
char addrStr[20];
#ifndef EMULATED
JsVar *addr = jswrap_ble_getAddress(); // Write MAC address in bottom right
JsVar *addr = jswrap_ble_getAddress(false); // Write MAC address in bottom right
#else
JsVar *addr = jsvNewFromString("Emulated");
#endif
Expand Down
8 changes: 4 additions & 4 deletions libs/bluetooth/jswrap_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void jswrap_ble_init() {
#if defined(USE_NFC) && defined(NFC_DEFAULT_URL)
// By default Puck.js's NFC will send you to the PuckJS website
// address is included so Web Bluetooth can connect to the correct one
JsVar *addr = jswrap_ble_getAddress();
JsVar *addr = jswrap_ble_getAddress(false);
JsVar *uri = jsvVarPrintf(NFC_DEFAULT_URL"?a=%v", addr);
jsvUnLock(addr);
jswrap_nfc_URL(uri);
Expand Down Expand Up @@ -708,7 +708,7 @@ void jswrap_ble_eraseBonds() {
"name" : "getAddress",
"generate" : "jswrap_ble_getAddress",
"params" : [
["current", "JsVar", "If true, return the current address rather than the default"]
["current", "bool", "If true, return the current address rather than the default"]
],
"return" : ["JsVar", "MAC address - a string of the form 'aa:bb:cc:dd:ee:ff'" ]
}
Expand All @@ -717,8 +717,8 @@ Get this device's default or current Bluetooth MAC address.
For Puck.js, the last 5 characters of this (e.g. `ee:ff`) are used in the
device's advertised Bluetooth name.
*/
JsVar *jswrap_ble_getAddress(JsVar *current) {
if (jsvGetBool(current)) {
JsVar *jswrap_ble_getAddress(bool current) {
if (current) {
JsVar *addr = jsvObjectGetChildIfExists(execInfo.hiddenRoot, BLE_NAME_MAC_ADDRESS);
if (addr) return addr;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/bluetooth/jswrap_bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void jswrap_ble_sleep();
void jswrap_ble_wake();
void jswrap_ble_restart(JsVar *callback);
void jswrap_ble_eraseBonds();
JsVar *jswrap_ble_getAddress();
JsVar *jswrap_ble_getAddress(bool current);
void jswrap_ble_setAddress(JsVar *address);
JsVar *jswrap_ble_resolveAddress(JsVar *address);

Expand Down
2 changes: 1 addition & 1 deletion libs/pixljs/jswrap_pixljs.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void jswrap_pixljs_init() {
}
jswrap_graphics_drawCString(&gfx,28,39,JS_VERSION);
// Write MAC address in bottom right
JsVar *addr = jswrap_ble_getAddress();
JsVar *addr = jswrap_ble_getAddress(false);
char buf[20];
jsvGetString(addr, buf, sizeof(buf));
jsvUnLock(addr);
Expand Down

0 comments on commit ed56105

Please sign in to comment.