Implementation of Gazell Pairing Library (gzp), Host functions. More...
#include "gzp.h"#include "gzll.h"#include "string.h"#include "stdint.h"#include "stdbool.h"#include "hal_aes.h"#include "hal_flash.h"#include "memdefs.h"Go to the source code of this file.
| Enumerations | |
| enum | gzp_id_req_stat_t { GZP_ID_REQ_IDLE, GZP_ID_REQ_PENDING, GZP_ID_REQ_PENDING_AND_GRANTED, GZP_ID_REQ_PENDING_AND_REJECTED } | 
| Functions | |
| void | gzp_host_chip_id_read (uint8_t *dst, uint8_t n) | 
| void | gzp_init () | 
| void | gzp_pairing_enable (_Bool enable) | 
| void | gzp_host_execute () | 
| _Bool | gzp_address_exchanged () | 
| _Bool | gzp_crypt_user_data_received () | 
| _Bool | gzp_crypt_user_data_read (uint8_t *dst, uint8_t *length) | 
| _Bool | gzp_id_req_received () | 
| void | gzp_id_req_reject () | 
| void | gzp_id_req_grant () | 
| void | gzp_id_req_cancel () | 
| _Bool | gzp_get_host_id (uint8_t *dst) | 
| Variables | |
| __no_init uint8_t | gzp_dyn_key [(16-3)] | 
Implementation of Gazell Pairing Library (gzp), Host functions.
Definition in file gzp_host.c.
| enum gzp_id_req_stat_t | 
Definition of internal states.
| GZP_ID_REQ_IDLE | |
| GZP_ID_REQ_PENDING | |
| GZP_ID_REQ_PENDING_AND_GRANTED | |
| GZP_ID_REQ_PENDING_AND_REJECTED | 
Definition at line 37 of file gzp_host.c.
| void gzp_host_chip_id_read | ( | uint8_t * | dst, | 
| uint8_t | n | ||
| ) | 
Function for reading unique chip ID.
Definition at line 28 of file gzp_host_le1.c.
{
  uint8_t i;
  
  if(hal_flash_byte_read(GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 1) == 0xff)
  {
    hal_flash_byte_write((GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 1), 0x00);
    hal_rng_power_up(true);
    for(i = 0; i < n; i++) 
    {
      while(!hal_rng_data_ready())
      ;
      hal_flash_byte_write((GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 2 + i),  hal_rng_read());
    }
    hal_rng_power_up(false);
  }
  
  for(i = 0; i < n; i++) 
  {
    *(dst++) = hal_flash_byte_read((GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 2 + i));
  }
}| _Bool gzp_get_host_id | ( | uint8_t * | dst ) | 
Function reading current "Host ID". On Host, returns false if host ID not yet generated.
Definition at line 388 of file gzp_host.c.
{
  if(hal_flash_byte_read(GZP_PARAMS_STORAGE_ADR) == 0)
  {
    hal_flash_bytes_read(GZP_PARAMS_STORAGE_ADR + 1, dst, GZP_HOST_ID_LENGTH);
    return true;
  }
  else
  {
    return false;
  }
}
| __no_init uint8_t gzp_dyn_key[(16-3)] | 
Definition at line 26 of file gzp_host_le1.c.
 1.7.2
 1.7.2