Map27
 All Classes Functions Variables Enumerations Enumerator Pages
ApplicationLayer.h
1 // ApplicationLayer.h
2 //
3 // Author: Mike McCauley (mikem@airspayce.com)
4 // Copyright (C) 2013 Mike McCauley
5 // $Id: ApplicationLayer.h,v 1.1 2013/07/14 06:32:28 mikem Exp $
6 
7 
8 #ifndef MAP27_APPLICATIONLAYER_H
9 #define MAP27_APPLICATIONLAYER_H
10 
11 #include <stdint.h>
12 
13 // Error types
14 #define MAP27_APPLICATION_ERROR_NO_ERROR 0
15 #define MAP27_APPLICATION_ERROR_REQUEST_TIMEOUT 1
16 #define MAP27_APPLICATION_ERROR_OPERATION_ABORTED 2
17 #define MAP27_APPLICATION_ERROR_INVALID_STATE 3
18 
19 class Map27Address;
20 class Map27NetworkLayer;
21 
30 {
31 public:
34 
39 
43 
47  void power_on();
48 
53  void poll();
54 
58 
62  virtual void error(uint8_t type);
63 
68  virtual void receiveStatus(Map27Address& address, uint8_t status);
69 
74  virtual void receiveStatusAck(Map27Address& address, uint8_t cause);
75 
80  virtual void receiveCleared(Map27Address& address, uint8_t cause);
81 
87  virtual void receiveSST(Map27Address& address, uint8_t* buf, uint8_t bufLen);
88 
93  virtual void receiveSSTAck(Map27Address& address, uint8_t cause);
94 
100  virtual void receiveMST(Map27Address& address, uint8_t* buf, uint8_t bufLen);
101 
107  virtual void receiveMSTAck(Map27Address& address, uint8_t cause);
108 
113  virtual void receiveSetupProgress(Map27Address& address, uint8_t cause);
114 
121  virtual void receiveIncomingVoiceModem(Map27Address& address, uint8_t details, uint8_t* buf, uint8_t bufLen);
122 
127  virtual void receiveProgress(Map27Address& address, uint8_t cause);
128 
133  virtual void receiveModemData(uint8_t* buf, uint8_t bufLen);
134 
145  virtual void receiveRadioPersonality(Map27Address& address, uint8_t manufacturers_code, uint8_t model,
146  uint32_t serial, uint8_t facilities_a, uint8_t facilities_b,
147  uint8_t facilities_c, uint8_t codings);
148 
152  virtual void receiveProtocolInfo(uint8_t reason);
153 
163  virtual void receiveNumberingInfo(Map27Address& address,
164  uint16_t individual_base, bool individual_base_3digit, uint16_t highest_ident,
165  uint16_t group_base, bool group_base_3digit, uint16_t highest_group);
166 
173  virtual void receiveRadioSettings(uint8_t controls_a, uint8_t controls_b, uint8_t controls_c, uint8_t codings);
174 
180  virtual void receiveOperatingCondition(uint8_t conditions, uint8_t field_strength, uint8_t max_call_duration);
181 
186  virtual void receiveNetworkInformation(uint16_t channel, uint16_t sys_ident);
187 
192  virtual void receiveRadioTestResult(uint8_t* buf, uint8_t bufLen);
193 
196 
199  virtual void link_ready();
200 
203  virtual void link_failure();
204 
207  virtual void packet_accepted();
208 
211  virtual void packet_rejected();
212 
213 private:
214  Map27NetworkLayer* _networkLayer; // The current Network Layer
215 };
216 
217 #endif
virtual void receiveIncomingVoiceModem(Map27Address &address, uint8_t details, uint8_t *buf, uint8_t bufLen)
Definition: ApplicationLayer.cpp:85
virtual void packet_accepted()
Definition: ApplicationLayer.cpp:147
virtual void receiveRadioSettings(uint8_t controls_a, uint8_t controls_b, uint8_t controls_c, uint8_t codings)
Definition: ApplicationLayer.cpp:117
Superclass for a generic Map27 application.
Definition: ApplicationLayer.h:29
virtual void receiveCleared(Map27Address &address, uint8_t cause)
Definition: ApplicationLayer.cpp:55
Map27ApplicationLayer()
Constructor.
Definition: ApplicationLayer.cpp:11
virtual void link_failure()
Definition: ApplicationLayer.cpp:142
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)
Definition: ApplicationLayer.cpp:100
void setNetworkLayer(Map27NetworkLayer *networkLayer)
Definition: ApplicationLayer.cpp:15
Manage the Network Layer of the Map27 protocol stack.
Definition: NetworkLayer.h:281
virtual void receiveMSTAck(Map27Address &address, uint8_t cause)
Definition: ApplicationLayer.cpp:75
Class for handling Map27 Prefix/Ident/Address.
Definition: Address.h:57
virtual void receiveProgress(Map27Address &address, uint8_t cause)
Definition: ApplicationLayer.cpp:90
void poll()
Definition: ApplicationLayer.cpp:32
virtual void receiveModemData(uint8_t *buf, uint8_t bufLen)
Definition: ApplicationLayer.cpp:95
virtual void receiveStatusAck(Map27Address &address, uint8_t cause)
Definition: ApplicationLayer.cpp:50
virtual void receiveProtocolInfo(uint8_t reason)
Definition: ApplicationLayer.cpp:105
virtual void receiveStatus(Map27Address &address, uint8_t status)
Definition: ApplicationLayer.cpp:45
Map27NetworkLayer * networkLayer()
Definition: ApplicationLayer.cpp:20
virtual void receiveSST(Map27Address &address, uint8_t *buf, uint8_t bufLen)
Definition: ApplicationLayer.cpp:60
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)
Definition: ApplicationLayer.cpp:110
virtual void receiveSSTAck(Map27Address &address, uint8_t cause)
Definition: ApplicationLayer.cpp:65
virtual void error(uint8_t type)
Definition: ApplicationLayer.cpp:40
virtual void receiveSetupProgress(Map27Address &address, uint8_t cause)
Definition: ApplicationLayer.cpp:80
virtual void receiveMST(Map27Address &address, uint8_t *buf, uint8_t bufLen)
Definition: ApplicationLayer.cpp:70
virtual void receiveOperatingCondition(uint8_t conditions, uint8_t field_strength, uint8_t max_call_duration)
Definition: ApplicationLayer.cpp:122
virtual void packet_rejected()
Definition: ApplicationLayer.cpp:152
virtual void receiveNetworkInformation(uint16_t channel, uint16_t sys_ident)
Definition: ApplicationLayer.cpp:127
void power_on()
Definition: ApplicationLayer.cpp:26
virtual void receiveRadioTestResult(uint8_t *buf, uint8_t bufLen)
Definition: ApplicationLayer.cpp:132
virtual void link_ready()
Definition: ApplicationLayer.cpp:137