update to pxt 5 and pxt-common-packages 6 (#934)
* bump pxt * fix build issues * Auto-gen of projects/summary * removing feild editors moved to pxt * various typing fixes * more typing fixes * fixing various typing issues * Start on integration of new pxt * serial number fixes * gc-ify MMap object * Re-build generated files * fix console listeners * clear lf() warnings * More generated files * also auto-generated * Compilation fixes * fix merge * mostly fixing blocks * fix sim * fix field motors * enable a few features * moving to tsx * try to fix edtiro compilation * more defs * removing commands * removing extra $ * fix blockly warning * hiding images * enabling more pxt features * hide images * setup autorun * add lock on target_reset * update deps * return trylock result * updated pxt * rename video section * add alpha channel * upgraded pxt * bump pxt/version * removed alpha ref * var ceanup * don't do major bump
This commit is contained in:
committed by
Peli de Halleux
parent
ba94322d4c
commit
c5cec3a6ba
@ -25,8 +25,8 @@ struct hci_dev_list_req {
|
||||
hci_dev_req dev_req[2];
|
||||
};
|
||||
|
||||
static uint32_t bt_addr() {
|
||||
uint32_t res = -1;
|
||||
static uint64_t bt_addr() {
|
||||
uint64_t res = -1;
|
||||
|
||||
int fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
|
||||
if (fd < 0) {
|
||||
@ -50,11 +50,8 @@ static uint32_t bt_addr() {
|
||||
goto done;
|
||||
}
|
||||
|
||||
memcpy(&res, di.bdaddr, 4);
|
||||
res *= 0x1000193;
|
||||
res += di.bdaddr[4];
|
||||
res *= 0x1000193;
|
||||
res += di.bdaddr[5];
|
||||
res = 0;
|
||||
memcpy(&res, di.bdaddr, 6);
|
||||
|
||||
done:
|
||||
close(fd);
|
||||
@ -63,14 +60,10 @@ done:
|
||||
|
||||
namespace pxt {
|
||||
|
||||
int getSerialNumber() {
|
||||
static int serial;
|
||||
|
||||
if (serial != 0)
|
||||
return serial;
|
||||
|
||||
serial = bt_addr() & 0x7fffffff;
|
||||
|
||||
uint64_t getLongSerialNumber() {
|
||||
static uint64_t serial;
|
||||
if (serial == 0)
|
||||
serial = bt_addr();
|
||||
return serial;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user