Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
464 B

  1. #include <usbd_cdc_if.h>
  2. #include <strobe_rng_init.h>
  3. #include <board.h>
  4. void
  5. hexdump(uint8_t *ptr, size_t len)
  6. {
  7. int i;
  8. for (i = 0; i < len; i++)
  9. usb_printf("%02x", ptr[i]);
  10. }
  11. int
  12. main(void)
  13. {
  14. uint8_t bytes[8];
  15. strobe_rng_init();
  16. board_init();
  17. HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
  18. wait_for_vcp();
  19. usb_printf("starting...\r\n");
  20. bare_strobe_randomize(bytes, sizeof bytes);
  21. hexdump(bytes, sizeof bytes);
  22. usb_printf("\r\n");
  23. }