// PULSE2 reliable transport application event registry

#ifndef _PULSE2_RELIABLE_APP_PROTOCOL_NUMBERS_DEFINED
#define _PULSE2_RELIABLE_APP_PROTOCOL_NUMBERS_DEFINED

#define PULSE2_RELIABLE_PROMPT_PROTOCOL (0x3e20)
#define PULSE2_BULKIO_PROTOCOL (0x3e21)
#define PULSE2_PEBBLE_PROTOCOL (0x3e22)

#endif

// Available directives:
//
//  ON_PACKET(number, packet_handler)
//
//    number:
//      The link-layer protocol number (uint16_t)
//
//    packet_handler:
//      Handler function for incoming packets.
//      The handler function must have the signature
//
//          void packet_handler(void *packet, size_t length);
//
//  ON_TRANSPORT_STATE_CHANGE(transport_up_handler, transport_down_handler)
//
//    transport_up_handler:
//      Handler function for when the reliable transport comes up. It will be
//      called when the reliable transport is ready to carry traffic.
//
//    transport_down_handler:
//      Handler function for when the reliable transport goes down. It will be
//      called when the reliable transport is no longer available to carry
//      traffic.
//
//    Both handler functions must have the signature
//
//        void transport_state_handler(void);

#if !DISABLE_PROMPT
ON_PACKET(PULSE2_RELIABLE_PROMPT_PROTOCOL, pulse2_prompt_packet_handler)
#endif

ON_PACKET(PULSE2_BULKIO_PROTOCOL, pulse2_bulkio_packet_handler)
ON_TRANSPORT_STATE_CHANGE(pulse2_bulkio_link_open_handler, pulse2_bulkio_link_closed_handler)

ON_PACKET(PULSE2_PEBBLE_PROTOCOL, pulse_pp_transport_handle_received_data)
ON_TRANSPORT_STATE_CHANGE(pulse_pp_transport_open_handler, pulse_pp_transport_closed_handler)

// vim: filetype=c
