mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-10-13 03:07:28 +02:00
Audit-clean C standard across all 5 cb challenges: fix 3 functions over 8 exec lines; rebuild bins; update CB-0x03 and CB-0x05 guides; verify all guides against new bins
This commit is contained in:
1 parent
4ade66738f
commit
23b9f628ef
51 files changed
+3744
-7904
No files matched your search
@@ -16,6 +16,11 @@
|
||||
|
||||
#define TOKEN_LEN 8
|
||||
|
||||
/**
|
||||
* @brief Decrypt the rolling authorization token into a buffer.
|
||||
* @param dest Pointer to buffer receiving the decrypted token bytes.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void decrypt_auth_token(uint8_t *dest);
|
||||
|
||||
#endif /* CRYPTO_H */
|
||||
@@ -17,10 +17,39 @@
|
||||
#define LED_GREEN_PIN 17
|
||||
#define TAMPER_WIRE_PIN 15
|
||||
|
||||
/**
|
||||
* @brief Initialize LED and tamper wire GPIO pins.
|
||||
* @param void No parameters.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void init_gpio(void);
|
||||
|
||||
/**
|
||||
* @brief Drive the armed indication LEDs (red on, green off).
|
||||
* @param void No parameters.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void set_led_armed(void);
|
||||
|
||||
/**
|
||||
* @brief Drive the safe indication LEDs (green on, red off).
|
||||
* @param void No parameters.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void set_led_safe(void);
|
||||
|
||||
/**
|
||||
* @brief Drive the tamper flash indication on the red LED.
|
||||
* @param state True to turn the red LED on, false to turn it off.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void set_led_tamper_flash(bool state);
|
||||
|
||||
/**
|
||||
* @brief Read the tamper wire loop state.
|
||||
* @param void No parameters.
|
||||
* @return true when the tamper wire is intact, false when cut.
|
||||
*/
|
||||
bool is_tamper_wire_intact(void);
|
||||
|
||||
#endif /* GPIO_CTRL_H */
|
||||
@@ -39,8 +39,26 @@
|
||||
#define LORA_TX_PIN 8
|
||||
#define LORA_RX_PIN 9
|
||||
|
||||
/**
|
||||
* @brief Initialize UART1 and configure the RYLR998 radio parameters.
|
||||
* @param void No parameters.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void init_lora(void);
|
||||
|
||||
/**
|
||||
* @brief Transmit a message over the LoRa link to the base station.
|
||||
* @param msg Null-terminated message string to transmit.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void lora_send(const char *msg);
|
||||
|
||||
/**
|
||||
* @brief Poll the UART receive buffer for a complete LoRa packet.
|
||||
* @param payload_out Buffer receiving the extracted payload string.
|
||||
* @param max_len Capacity of payload_out in bytes.
|
||||
* @return true when a payload was extracted, false otherwise.
|
||||
*/
|
||||
bool lora_poll_packet(char *payload_out, size_t max_len);
|
||||
|
||||
#endif // LORA_H
|
||||
@@ -18,7 +18,18 @@
|
||||
#define STATE_WARHEAD_SAFE 0x03
|
||||
#define STATE_TAMPER_TRIP 0xFF
|
||||
|
||||
/**
|
||||
* @brief Initialize the safe-and-arm controller subsystem.
|
||||
* @param void No parameters.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void init_safe_arm_controller(void);
|
||||
|
||||
/**
|
||||
* @brief Process one iteration of the safe-and-arm event loop.
|
||||
* @param void No parameters.
|
||||
* @return void No return value.
|
||||
*/
|
||||
void process_safe_arm_tick(void);
|
||||
|
||||
#endif /* SAFE_ARM_H */
|
||||
Reference in new issue
Block a user