Map27
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
Map27ApplicationLayer Class Reference

Superclass for a generic Map27 application. More...

#include <Map27/ApplicationLayer.h>

Inheritance diagram for Map27ApplicationLayer:
MyApplication

Public Member Functions

 Map27ApplicationLayer ()
 Constructor.
 
void setNetworkLayer (Map27NetworkLayer *networkLayer)
 
Map27NetworkLayernetworkLayer ()
 
void power_on ()
 
void poll ()
 
Inputs from Network Layer

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)
 

Network layer events

These functions register other Network Layer events

virtual void link_ready ()
 
virtual void link_failure ()
 
virtual void packet_accepted ()
 
virtual void packet_rejected ()
 

Detailed Description

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.

Member Function Documentation

void Map27ApplicationLayer::error ( uint8_t  type)
virtual

Called by Network Layer when an error is being reported to the Application Layer.

Parameters
[in]typeThe 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.

Map27NetworkLayer * Map27ApplicationLayer::networkLayer ( )

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]addressThe Address of the calling, called or connected party
[in]causeCancellation 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]addressThe Address of the calling party
[in]detailsCall details. One of MAP27_NETWORK_MESSAGE_INCOMING_VOICE_MODEM_DETAILS_*
[in]bufParameter bits. Up to 44 bits in 5 and a half octets, only with customised services.
[in]bufLenNumber 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]bufPointer to start of data
[in]bufLenNumber 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]addressThe Address of the calling party
[in]bufPointer to the octets of the received MST message, starting with the CODING/NLB octet
[in]bufLenThe 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]addressThe Address of the called party
[in]causeReason 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]channelRadio channel number
[in]sys_identSystem 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]addressRadio unit address
[in]individual_baseindividual number base ident (IBI)
[in]individual_base_3digitIBI is 3-digit
[in]highest_identHighest indviual ident
[in]group_baseGroup number base ident
[in]group_base_3digitGroup number base ident is 3-digit
[in]highest_groupHighest 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]conditionsOperating conditions. Mask of MAP27_NETWORK_MESSAGE_OPERATING_CONDITION_CONDITION_*
[in]field_strengthReceived field strength. One of MAP27_NETWORK_MESSAGE_OPERATING_CONDITION_FIELD_STRENGTH_*
[in]max_call_durationMaximum 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]addressThe Address of the calling party
[in]causeReason 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]reasonReason 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]addressRadio unit address
[in]manufacturers_codeManufacturers code
[in]modelRadio model number
[in]serialRadio serial number
[in]facilities_aList of supported facilities. Mask of MAP27_NETWORK_MESSAGE_RADIO_PERSONALITY_FACILITIESA_*
[in]facilities_bReserved
[in]facilities_cReserved
[in]codingsSupported 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_aActivated facilities, Mask of MAP27_NETWORK_MESSAGE_RADIO_MANAGEMENT_CONTROLS_*
[in]controls_bReserved
[in]controls_cReserved
[in]codingsActivated 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]bufPointer to test results data.
[in]bufLenNumber 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]addressThe Address of the called party
[in]causeReason 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]addressThe Address of the calling party
[in]bufPointer to the octets of the received SST message, starting with the CODING/NLB octet
[in]bufLenThe 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]addressThe Address of the called party
[in]causeReason 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]addressThe Address of the calling party
[in]statusThe 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]addressThe Address of the calling party
[in]causeReason for sending this message. One of MAP27_NETWORK_MESSAGE_STATUS_CAUSE_*
void Map27ApplicationLayer::setNetworkLayer ( Map27NetworkLayer networkLayer)

Sets the pointer to the NetworkLayer to use to communicate with the Map27 radio.

Parameters
[in]networkLayerPointer to the Network Layer
Examples:
test3.cpp.

The documentation for this class was generated from the following files: