mirror of
https://github.com/google/pebble.git
synced 2025-07-17 19:46:40 -04:00
32 lines
1.3 KiB
C
32 lines
1.3 KiB
C
// Registry for protocols which handle PULSE frames.
|
|
// http://en.wikibooks.org/wiki/C_Programming/Preprocessor#X-Macros
|
|
|
|
#ifndef _PULSE_PROTOCOL_NUMBERS_DEFINED
|
|
#define _PULSE_PROTOCOL_NUMBERS_DEFINED
|
|
|
|
#define PULSE_PROTOCOL_LLC (1)
|
|
#define PULSE_PROTOCOL_FLASH_IMAGING (2)
|
|
#define PULSE_PROTOCOL_LOGGING (3)
|
|
#define PULSE_PROTOCOL_PROMPT (4)
|
|
|
|
#endif // _PULSE_PROTOCOL_NUMBERS_DEFINED
|
|
|
|
// Syntax: REGISTER_PROTOCOL(number, handler_function)
|
|
// where handler_function is a function with the signature
|
|
// void handler_function(void *packet, size_t length)
|
|
// This function will be called whenever a PULSE frame is received which bears
|
|
// the specified protocol number.
|
|
//
|
|
// A function signature for each handler is automatically generated in
|
|
// pulse_protocol_impl.h. Simply include that header in the source file
|
|
// where the protocol handler is defined to get the function signature
|
|
// definition.
|
|
|
|
// DO NOT REMOVE THIS PROTOCOL!
|
|
#if !PULSE_EVERYWHERE
|
|
REGISTER_PROTOCOL(PULSE_PROTOCOL_LLC, pulse_llc_handler, pulse_llc_link_state_handler)
|
|
REGISTER_PROTOCOL(PULSE_PROTOCOL_PROMPT, pulse_prompt_handler, pulse_prompt_link_state_handler)
|
|
#endif
|
|
REGISTER_PROTOCOL(PULSE_PROTOCOL_FLASH_IMAGING, pulse_flash_imaging_handler, pulse_flash_imaging_link_state_handler)
|
|
|
|
// vim:filetype=c
|