-typedef bool (*send_data_t)(void *handle, uint8_t type, const char *data, size_t len);
-typedef bool (*receive_record_t)(void *handle, uint8_t type, const char *data, uint16_t len);
+typedef bool (*send_data_t)(void *handle, uint8_t type, const void *data, size_t len);
+typedef bool (*receive_record_t)(void *handle, uint8_t type, const void *data, uint16_t len);
+
+// Key exchange states
+typedef enum sptps_state_t {
+ SPTPS_KEX = 1, // Waiting for the first Key EXchange record
+ SPTPS_SECONDARY_KEX = 2, // Ready to receive a secondary Key EXchange record
+ SPTPS_SIG = 3, // Waiting for a SIGnature record
+ SPTPS_ACK = 4, // Waiting for an ACKnowledgement record
+} sptps_state_t;