Superclass for a generic Map27 application.
More...
#include <Map27/ApplicationLayer.h>
|
| Map27ApplicationLayer () |
| Constructor.
|
|
void | setNetworkLayer (Map27NetworkLayer *networkLayer) |
|
Map27NetworkLayer * | networkLayer () |
|
void | power_on () |
|
void | poll () |
|
|
Override these in your subclass to get control when certain events happen. The default implementations do nothing but log the event at DEBUG level.
|
virtual void | error (uint8_t type) |
|
virtual void | receiveStatus (Map27Address &address, uint8_t status) |
|
virtual void | receiveStatusAck (Map27Address &address, uint8_t cause) |
|
virtual void | receiveCleared (Map27Address &address, uint8_t cause) |
|
virtual void | receiveSST (Map27Address &address, uint8_t *buf, uint8_t bufLen) |
|
virtual void | receiveSSTAck (Map27Address &address, uint8_t cause) |
|
virtual void | receiveMST (Map27Address &address, uint8_t *buf, uint8_t bufLen) |
|
virtual void | receiveMSTAck (Map27Address &address, uint8_t cause) |
|
virtual void | receiveSetupProgress (Map27Address &address, uint8_t cause) |
|
virtual void | receiveIncomingVoiceModem (Map27Address &address, uint8_t details, uint8_t *buf, uint8_t bufLen) |
|
virtual void | receiveProgress (Map27Address &address, uint8_t cause) |
|
virtual void | receiveModemData (uint8_t *buf, uint8_t bufLen) |
|
virtual void | receiveRadioPersonality (Map27Address &address, uint8_t manufacturers_code, uint8_t model, uint32_t serial, uint8_t facilities_a, uint8_t facilities_b, uint8_t facilities_c, uint8_t codings) |
|
virtual void | receiveProtocolInfo (uint8_t reason) |
|
virtual void | receiveNumberingInfo (Map27Address &address, uint16_t individual_base, bool individual_base_3digit, uint16_t highest_ident, uint16_t group_base, bool group_base_3digit, uint16_t highest_group) |
|
virtual void | receiveRadioSettings (uint8_t controls_a, uint8_t controls_b, uint8_t controls_c, uint8_t codings) |
|
virtual void | receiveOperatingCondition (uint8_t conditions, uint8_t field_strength, uint8_t max_call_duration) |
|
virtual void | receiveNetworkInformation (uint16_t channel, uint16_t sys_ident) |
|
virtual void | receiveRadioTestResult (uint8_t *buf, uint8_t bufLen) |
|
Superclass for a generic Map27 application.
This class is intended as a generic superclass, to be used as the base for constructing a specific Map27 application. Application developers are expected to create a specific subclass for their application, instantiate it and connect it to a Map27NetworkLayer instance.
- Examples:
- test.cpp, and test3.cpp.
void Map27ApplicationLayer::error |
( |
uint8_t |
type | ) |
|
|
virtual |
Called by Network Layer when an error is being reported to the Application Layer.
- Parameters
-
[in] | type | The error type. One of MAP27_APPLICATION_ERROR_* |
void Map27ApplicationLayer::link_failure |
( |
| ) |
|
|
virtual |
Called by the Network Layer when the RS232 link to the Radio is lost
Reimplemented in MyApplication.
void Map27ApplicationLayer::link_ready |
( |
| ) |
|
|
virtual |
Called by the Network Layer when the RS232 link to the Radio is established or re-established
Reimplemented in MyApplication.
Get the current Network Layer pointer.
- Returns
- The current Network Layer pointer, or NULL if previously set.
- Examples:
- test.cpp.
void Map27ApplicationLayer::packet_accepted |
( |
| ) |
|
|
virtual |
Called by the Network Layer when a mesage is successfully queued for delivery to the radio
void Map27ApplicationLayer::packet_rejected |
( |
| ) |
|
|
virtual |
Called by the Network Layer when a mesage is rejected for delivery to the radio
void Map27ApplicationLayer::poll |
( |
| ) |
|
Polls the Network Layer and any of its lower layers for activity. In Unix/Linux and Arduino environments, you are required to call this at least as frequently as octets might be received from the radio. At least every 10msec would be appropriate for a 9600 baud connection
- Examples:
- test3.cpp.
void Map27ApplicationLayer::power_on |
( |
| ) |
|
Powers on the application and lower layers Calls power_on() in the Network Layer. You may consider overriding this to provide Application specific behaviour
- Examples:
- test3.cpp.
void Map27ApplicationLayer::receiveCleared |
( |
Map27Address & |
address, |
|
|
uint8_t |
cause |
|
) |
| |
|
virtual |
Called by Network Layer when a CLEARED (5.2.2.6.2) message is received.
- Parameters
-
[in] | address | The Address of the calling, called or connected party |
[in] | cause | Cancellation or disconnection reason. One of MAP27_NETWORK_MESSAGE_CLEARED_CAUSE_* |
void Map27ApplicationLayer::receiveIncomingVoiceModem |
( |
Map27Address & |
address, |
|
|
uint8_t |
details, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
bufLen |
|
) |
| |
|
virtual |
Called by Network Layer when an INCOMING VOICE CALL / INCOMING MODEM CALL (5.2.2.4.4) message is received.
- Parameters
-
[in] | address | The Address of the calling party |
[in] | details | Call details. One of MAP27_NETWORK_MESSAGE_INCOMING_VOICE_MODEM_DETAILS_* |
[in] | buf | Parameter bits. Up to 44 bits in 5 and a half octets, only with customised services. |
[in] | bufLen | Number of octets in buf. |
void Map27ApplicationLayer::receiveModemData |
( |
uint8_t * |
buf, |
|
|
uint8_t |
bufLen |
|
) |
| |
|
virtual |
Called by Network Layer when a RECEIVE MODEM DATA (5.2.2.5.2) message is received.
- Parameters
-
[in] | buf | Pointer to start of data |
[in] | bufLen | Number of bytes in buf |
void Map27ApplicationLayer::receiveMST |
( |
Map27Address & |
address, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
bufLen |
|
) |
| |
|
virtual |
Called by Network Layer when a RECEIVE MST (5.2.2.3.2) message is received.
- Parameters
-
[in] | address | The Address of the calling party |
[in] | buf | Pointer to the octets of the received MST message, starting with the CODING/NLB octet |
[in] | bufLen | The number of octets in thje received message, including the CODING/NLB octet |
void Map27ApplicationLayer::receiveMSTAck |
( |
Map27Address & |
address, |
|
|
uint8_t |
cause |
|
) |
| |
|
virtual |
Called by Network Layer when a MST ACK (5.2.2.3.3) message is received.
- Parameters
-
[in] | address | The Address of the called party |
[in] | cause | Reason for sending this message. One of MAP27_NETWORK_MESSAGE_SST_ACK_* or MAP27_NETWORK_MESSAGE_MST_ACK_* |
void Map27ApplicationLayer::receiveNetworkInformation |
( |
uint16_t |
channel, |
|
|
uint16_t |
sys_ident |
|
) |
| |
|
virtual |
Called by Network Layer when a NETWORK INFORMATION (5.2.2.8.6) message is received.
- Parameters
-
[in] | channel | Radio channel number |
[in] | sys_ident | System identity code |
void Map27ApplicationLayer::receiveNumberingInfo |
( |
Map27Address & |
address, |
|
|
uint16_t |
individual_base, |
|
|
bool |
individual_base_3digit, |
|
|
uint16_t |
highest_ident, |
|
|
uint16_t |
group_base, |
|
|
bool |
group_base_3digit, |
|
|
uint16_t |
highest_group |
|
) |
| |
|
virtual |
Called by Network Layer when a NUMBERING INFORMATION (5.2.2.8.3) message is received.
- Parameters
-
[in] | address | Radio unit address |
[in] | individual_base | individual number base ident (IBI) |
[in] | individual_base_3digit | IBI is 3-digit |
[in] | highest_ident | Highest indviual ident |
[in] | group_base | Group number base ident |
[in] | group_base_3digit | Group number base ident is 3-digit |
[in] | highest_group | Highest group ident |
void Map27ApplicationLayer::receiveOperatingCondition |
( |
uint8_t |
conditions, |
|
|
uint8_t |
field_strength, |
|
|
uint8_t |
max_call_duration |
|
) |
| |
|
virtual |
Called by Network Layer when a OPERATING CONDITION (5.2.2.8.5) message is received.
- Parameters
-
[in] | conditions | Operating conditions. Mask of MAP27_NETWORK_MESSAGE_OPERATING_CONDITION_CONDITION_* |
[in] | field_strength | Received field strength. One of MAP27_NETWORK_MESSAGE_OPERATING_CONDITION_FIELD_STRENGTH_* |
[in] | max_call_duration | Maximum call duration time. One of MAP27_NETWORK_MESSAGE_OPERATING_CONDITION_CALL_DURATION_* and others. |
void Map27ApplicationLayer::receiveProgress |
( |
Map27Address & |
address, |
|
|
uint8_t |
cause |
|
) |
| |
|
virtual |
Called by Network Layer when a RECEIVE PROGRESS (5.2.2.4.6) message is received.
- Parameters
-
[in] | address | The Address of the calling party |
[in] | cause | Reason for sending this message. One of MAP27_NETWORK_MESSAGE_RECEIVE_PRGRESS_CAUSE_* |
void Map27ApplicationLayer::receiveProtocolInfo |
( |
uint8_t |
reason | ) |
|
|
virtual |
Called by Network Layer when a PROTOCOL INFO (5.2.2.8.9) message is received.
- Parameters
-
[in] | reason | Reason to send this message. One of MAP27_NETWORK_MESSAGE_PROTOCOL_INFO_ |
void Map27ApplicationLayer::receiveRadioPersonality |
( |
Map27Address & |
address, |
|
|
uint8_t |
manufacturers_code, |
|
|
uint8_t |
model, |
|
|
uint32_t |
serial, |
|
|
uint8_t |
facilities_a, |
|
|
uint8_t |
facilities_b, |
|
|
uint8_t |
facilities_c, |
|
|
uint8_t |
codings |
|
) |
| |
|
virtual |
Called by Network Layer when a RADIO PERSONALITY (5.2.2.8.2) message is received.
- Parameters
-
[in] | address | Radio unit address |
[in] | manufacturers_code | Manufacturers code |
[in] | model | Radio model number |
[in] | serial | Radio serial number |
[in] | facilities_a | List of supported facilities. Mask of MAP27_NETWORK_MESSAGE_RADIO_PERSONALITY_FACILITIESA_* |
[in] | facilities_b | Reserved |
[in] | facilities_c | Reserved |
[in] | codings | Supported codings. Mask of MAP27_NETWORK_MESSAGE_RADIO_PERSONALITY_CODINGS_ |
Reimplemented in MyApplication.
void Map27ApplicationLayer::receiveRadioSettings |
( |
uint8_t |
controls_a, |
|
|
uint8_t |
controls_b, |
|
|
uint8_t |
controls_c, |
|
|
uint8_t |
codings |
|
) |
| |
|
virtual |
Called by Network Layer whena RADIO SETTINGS (5.2.2.8.8) message is received.
- Parameters
-
[in] | controls_a | Activated facilities, Mask of MAP27_NETWORK_MESSAGE_RADIO_MANAGEMENT_CONTROLS_* |
[in] | controls_b | Reserved |
[in] | controls_c | Reserved |
[in] | codings | Activated coding type. Mask of MAP27_NETWORK_MESSAGE_RADIO_PERSONALITY_CODINGS_* |
void Map27ApplicationLayer::receiveRadioTestResult |
( |
uint8_t * |
buf, |
|
|
uint8_t |
bufLen |
|
) |
| |
|
virtual |
Called by Network Layer when a RADIO TEST RESULT (5.2.2.8.13) message is received.
- Parameters
-
[in] | buf | Pointer to test results data. |
[in] | bufLen | Number of bytes in buf. |
void Map27ApplicationLayer::receiveSetupProgress |
( |
Map27Address & |
address, |
|
|
uint8_t |
cause |
|
) |
| |
|
virtual |
Called by Network Layer when a SETUP PROGRESS (5.2.2.4.3) message is received.
- Parameters
-
[in] | address | The Address of the called party |
[in] | cause | Reason for sending this message. One of MAP27_NETWORK_MESSAGE_SETUP_PROGRESS_CAUSE_* |
void Map27ApplicationLayer::receiveSST |
( |
Map27Address & |
address, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
bufLen |
|
) |
| |
|
virtual |
Called by Network Layer when a RECEIVE SST (5.2.2.2.2) message is received.
- Parameters
-
[in] | address | The Address of the calling party |
[in] | buf | Pointer to the octets of the received SST message, starting with the CODING/NLB octet |
[in] | bufLen | The number of octets in thje received message, including the CODING/NLB octet |
- Examples:
- test.cpp.
void Map27ApplicationLayer::receiveSSTAck |
( |
Map27Address & |
address, |
|
|
uint8_t |
cause |
|
) |
| |
|
virtual |
Called by Network Layer when a SST ACK (5.2.2.2.3) message is received.
- Parameters
-
[in] | address | The Address of the called party |
[in] | cause | Reason for sending this message. One of MAP27_NETWORK_MESSAGE_SST_ACK_* |
void Map27ApplicationLayer::receiveStatus |
( |
Map27Address & |
address, |
|
|
uint8_t |
status |
|
) |
| |
|
virtual |
Called by Network Layer when a RECEIVE STATUS (5.2.2.1.2) is received.
- Parameters
-
[in] | address | The Address of the calling party |
[in] | status | The status, one of MAP27_NETWORK_MESSAGE_STATUS_* |
- Examples:
- test.cpp.
void Map27ApplicationLayer::receiveStatusAck |
( |
Map27Address & |
address, |
|
|
uint8_t |
cause |
|
) |
| |
|
virtual |
Called by Network Layer when a STATUS ACK (5.2.2.1.3) message is received.
- Parameters
-
[in] | address | The Address of the calling party |
[in] | cause | Reason for sending this message. One of MAP27_NETWORK_MESSAGE_STATUS_CAUSE_* |
Sets the pointer to the NetworkLayer to use to communicate with the Map27 radio.
- Parameters
-
[in] | networkLayer | Pointer to the Network Layer |
- Examples:
- test3.cpp.
The documentation for this class was generated from the following files: