Vodafone Test Suite
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test26.h@60:7efce4a3c26f, 2012-10-23 (annotated)
- Committer:
- ashleymills
- Date:
- Tue Oct 23 14:22:53 2012 +0000
- Revision:
- 60:7efce4a3c26f
- Parent:
- 44:6d0ac4747f5b
Added new SMS bulk test (incomplete).
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 22:5b1feecf2aeb | 1 | #pragma once |
ashleymills | 22:5b1feecf2aeb | 2 | #include "VodafoneTestCase.h" |
ashleymills | 25:55b865c41f21 | 3 | |
ashleymills | 37:847f5f86e9ff | 4 | extern const char* gTest26Description; |
ashleymills | 25:55b865c41f21 | 5 | |
ashleymills | 22:5b1feecf2aeb | 6 | class Test26 : public VodafoneTestCase { |
ashleymills | 22:5b1feecf2aeb | 7 | public: |
ashleymills | 60:7efce4a3c26f | 8 | Test26(VodafoneUSBModem *m) : VodafoneTestCase(m) {} |
ashleymills | 44:6d0ac4747f5b | 9 | |
ashleymills | 44:6d0ac4747f5b | 10 | private: |
ashleymills | 22:5b1feecf2aeb | 11 | |
ashleymills | 22:5b1feecf2aeb | 12 | virtual void setupTest() { |
ashleymills | 23:408199b5d2cb | 13 | |
ashleymills | 22:5b1feecf2aeb | 14 | } |
ashleymills | 22:5b1feecf2aeb | 15 | |
ashleymills | 44:6d0ac4747f5b | 16 | virtual bool executeTest() { |
ashleymills | 25:55b865c41f21 | 17 | LOG(gTest26Description); |
ashleymills | 22:5b1feecf2aeb | 18 | for(int count=0; count<30; count++) { |
ashleymills | 22:5b1feecf2aeb | 19 | LOG("Iteration %d of 30",count); |
ashleymills | 22:5b1feecf2aeb | 20 | int rssi = -1000; |
ashleymills | 22:5b1feecf2aeb | 21 | LinkMonitor::REGISTRATION_STATE regState = LinkMonitor::REGISTRATION_STATE_UNKNOWN; |
ashleymills | 22:5b1feecf2aeb | 22 | LinkMonitor::BEARER bearer = LinkMonitor::BEARER_UNKNOWN; |
ashleymills | 22:5b1feecf2aeb | 23 | |
ashleymills | 22:5b1feecf2aeb | 24 | if(_modem->getLinkState(&rssi, ®State, &bearer)==0) { |
ashleymills | 22:5b1feecf2aeb | 25 | if(rssi==-1000) { |
ashleymills | 22:5b1feecf2aeb | 26 | LOG("RSSI: Error."); |
ashleymills | 22:5b1feecf2aeb | 27 | return false; |
ashleymills | 22:5b1feecf2aeb | 28 | } else { |
ashleymills | 22:5b1feecf2aeb | 29 | LOG("RSSI: %d",rssi); |
ashleymills | 22:5b1feecf2aeb | 30 | } |
ashleymills | 22:5b1feecf2aeb | 31 | |
ashleymills | 22:5b1feecf2aeb | 32 | switch(regState) { |
ashleymills | 22:5b1feecf2aeb | 33 | case LinkMonitor::REGISTRATION_STATE_UNKNOWN: |
ashleymills | 22:5b1feecf2aeb | 34 | LOG("regState: UNKNOWN. Failing."); |
ashleymills | 22:5b1feecf2aeb | 35 | return false; |
ashleymills | 22:5b1feecf2aeb | 36 | case LinkMonitor::REGISTRATION_STATE_REGISTERING: |
ashleymills | 22:5b1feecf2aeb | 37 | LOG("regState: REGISTERING"); |
ashleymills | 22:5b1feecf2aeb | 38 | break; |
ashleymills | 22:5b1feecf2aeb | 39 | case LinkMonitor::REGISTRATION_STATE_DENIED: |
ashleymills | 22:5b1feecf2aeb | 40 | LOG("regState: DENIED"); |
ashleymills | 22:5b1feecf2aeb | 41 | break; |
ashleymills | 22:5b1feecf2aeb | 42 | case LinkMonitor::REGISTRATION_STATE_NO_SIGNAL: |
ashleymills | 22:5b1feecf2aeb | 43 | LOG("regState: NO SIGNAL"); |
ashleymills | 22:5b1feecf2aeb | 44 | break; |
ashleymills | 22:5b1feecf2aeb | 45 | case LinkMonitor::REGISTRATION_STATE_HOME_NETWORK: |
ashleymills | 22:5b1feecf2aeb | 46 | LOG("regState: HOME NETWORK"); |
ashleymills | 22:5b1feecf2aeb | 47 | break; |
ashleymills | 22:5b1feecf2aeb | 48 | case LinkMonitor::REGISTRATION_STATE_ROAMING: |
ashleymills | 22:5b1feecf2aeb | 49 | LOG("regState: ROAMING"); |
ashleymills | 22:5b1feecf2aeb | 50 | break; |
ashleymills | 22:5b1feecf2aeb | 51 | default: |
ashleymills | 22:5b1feecf2aeb | 52 | LOG("regState: ERROR. Failing."); |
ashleymills | 22:5b1feecf2aeb | 53 | return false; |
ashleymills | 22:5b1feecf2aeb | 54 | } |
ashleymills | 22:5b1feecf2aeb | 55 | |
ashleymills | 22:5b1feecf2aeb | 56 | switch(bearer) { |
ashleymills | 22:5b1feecf2aeb | 57 | case LinkMonitor::BEARER_UNKNOWN: |
ashleymills | 22:5b1feecf2aeb | 58 | LOG("bearer: UNKNOWN. Failing."); |
ashleymills | 22:5b1feecf2aeb | 59 | return false; |
ashleymills | 22:5b1feecf2aeb | 60 | case LinkMonitor::BEARER_GSM: |
ashleymills | 22:5b1feecf2aeb | 61 | LOG("bearer: GSM"); |
ashleymills | 22:5b1feecf2aeb | 62 | break; |
ashleymills | 22:5b1feecf2aeb | 63 | case LinkMonitor::BEARER_EDGE: |
ashleymills | 22:5b1feecf2aeb | 64 | LOG("bearer: EDGE"); |
ashleymills | 22:5b1feecf2aeb | 65 | break; |
ashleymills | 22:5b1feecf2aeb | 66 | case LinkMonitor::BEARER_UMTS: |
ashleymills | 22:5b1feecf2aeb | 67 | LOG("bearer: UMTS"); |
ashleymills | 22:5b1feecf2aeb | 68 | break; |
ashleymills | 22:5b1feecf2aeb | 69 | case LinkMonitor::BEARER_HSPA: |
ashleymills | 22:5b1feecf2aeb | 70 | LOG("bearer: HSPA"); |
ashleymills | 22:5b1feecf2aeb | 71 | break; |
ashleymills | 22:5b1feecf2aeb | 72 | case LinkMonitor::BEARER_LTE: |
ashleymills | 22:5b1feecf2aeb | 73 | LOG("bearer: LTE"); |
ashleymills | 22:5b1feecf2aeb | 74 | break; |
ashleymills | 22:5b1feecf2aeb | 75 | default: |
ashleymills | 22:5b1feecf2aeb | 76 | LOG("bearer: ERROR. Failing."); |
ashleymills | 22:5b1feecf2aeb | 77 | return false; |
ashleymills | 22:5b1feecf2aeb | 78 | } |
ashleymills | 22:5b1feecf2aeb | 79 | } else { |
ashleymills | 22:5b1feecf2aeb | 80 | return false; |
ashleymills | 22:5b1feecf2aeb | 81 | } |
ashleymills | 22:5b1feecf2aeb | 82 | } |
ashleymills | 22:5b1feecf2aeb | 83 | |
ashleymills | 22:5b1feecf2aeb | 84 | return true; |
ashleymills | 22:5b1feecf2aeb | 85 | } |
ashleymills | 22:5b1feecf2aeb | 86 | |
ashleymills | 22:5b1feecf2aeb | 87 | virtual void endTest() { |
ashleymills | 23:408199b5d2cb | 88 | |
ashleymills | 22:5b1feecf2aeb | 89 | } |
ashleymills | 22:5b1feecf2aeb | 90 | |
ashleymills | 22:5b1feecf2aeb | 91 | }; |
ashleymills | 22:5b1feecf2aeb | 92 |