You've already forked M5-ProductExampleCodes
mirror of
https://github.com/m5stack/M5-ProductExampleCodes.git
synced 2026-05-20 10:24:10 -07:00
23 lines
409 B
C
23 lines
409 B
C
#include "pairing.h"
|
|
|
|
|
|
pairing_t *pairing_new() {
|
|
pairing_t *p = malloc(sizeof(pairing_t));
|
|
p->id = -1;
|
|
p->device_id = NULL;
|
|
p->device_key = NULL;
|
|
p->permissions = 0;
|
|
|
|
return p;
|
|
}
|
|
|
|
void pairing_free(pairing_t *pairing) {
|
|
if (pairing->device_id)
|
|
free(pairing->device_id);
|
|
|
|
if (pairing->device_key)
|
|
crypto_ed25519_free(pairing->device_key);
|
|
|
|
free(pairing);
|
|
}
|