openpilot v0.9.6 release
date: 2024-01-12T10:13:37 master commit: ba792d576a49a0899b88a753fa1c52956bedf9e6
This commit is contained in:
17
panda/board/provision.h
Normal file
17
panda/board/provision.h
Normal file
@@ -0,0 +1,17 @@
|
||||
// this is where we manage the dongle ID assigned during our
|
||||
// manufacturing. aside from this, there's a UID for the MCU
|
||||
|
||||
#define PROVISION_CHUNK_LEN 0x20
|
||||
|
||||
void get_provision_chunk(uint8_t *resp) {
|
||||
(void)memcpy(resp, (uint8_t *)PROVISION_CHUNK_ADDRESS, PROVISION_CHUNK_LEN);
|
||||
if (memcmp(resp, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0x20) == 0) {
|
||||
(void)memcpy(resp, "unprovisioned\x00\x00\x00testing123\x00\x00\xa3\xa6\x99\xec", 0x20);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t chunk[PROVISION_CHUNK_LEN];
|
||||
bool is_provisioned(void) {
|
||||
(void)memcpy(chunk, (uint8_t *)PROVISION_CHUNK_ADDRESS, PROVISION_CHUNK_LEN);
|
||||
return (memcmp(chunk, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0x20) != 0);
|
||||
}
|
||||
Reference in New Issue
Block a user