Quake Global 96XXCS Q4000 / QPRO Satellite Module User Manual 1135 4713G GREEN Users Guide to Q4000 QPRO

Quake Global Inc. Q4000 / QPRO Satellite Module 1135 4713G GREEN Users Guide to Q4000 QPRO

Full Manual part 4

  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 80 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) 12.2.5  Making “Hello, World!” The process of modifying an application, then downloading and running it on the modem, can be demonstrated by altering the Turnkey application to print “Hello, world!”  to the Logger port. 1.  In the IAR workspace window, expand the Turnkey group by clicking on the ‘+’  and then double-clicking on APL.c.  This will open the file in the editor window:  Figure 12-17:  Turnkey APL.c file
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 81 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) If additional changes are required after compiling, it is a good idea to first select "Clean" from the Project menu before recompiling.  This removes the existing object files and insures that the subsequent "Make" does a completely new compile and build, without using any previously compiled object files. 2.  Use Ctrl/F to search for POWER_ON.  In the function processEvent(), you should see the line case POWER_ON:  3.  Modify APL.c by adding printf("\r\nHello, world!\r\n"); under the POWER_ON line. The file with the modifications should appear as in Figure 12-18 below:    Figure 12-18:  Modify Turnkey APL.c by adding a printf statement  4.  After making the modification, select Make (F7) to save the changes and rebuild the project. If there are errors shown in the bottom window, correct these and rebuild.  This creates the new binary file, TurnKey.bin, which you then load into the modem with the QUAKE Configuration Tool (QCT), as described in Section 12.2.2.           Note:
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 82 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) Turnkey is written in network-agnostic code; that is, the same code can be used for any satellite network with no changes required.  Please note that Turnkey is the only sample application written in this manner.  All the other sample applications are written in network-dependent code, meaning they must be changed when switching between satellite networks. 5.  Once you have downloaded the new application file with “Hello, World,” cycle power on the modem.  You should see the following output on the Logger port:  Figure 12-19:  Logger output with "Hello, World!" 12.2.6  Additional detail on Turnkey The Turnkey application allows the user to set configuration parameters to control when it sends a report and what is contained in the report data.  The application can report a GPS position fix, DIO and Analog values, as well as CAN data.  It accepts parameter changes received over the air or from a serial port.  It can also accept an application update over GPRS.  The application can be used as is, or it can serve as the basis for a more complex user application.  We have seen how to set up the IDE, and build, load and execute the Turnkey application. We now examine the Turnkey code in more detail in order to understand the QUAKE Event Framework.    The main loop of Turnkey initializes configuration parameters, sets up serial port handling by registering a callback function for each serial port in use, generates a power-on event and enters a while loop where it checks for messages in its queue and processes them.  Most events are         Note:
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 83 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) handled in a single function called processEvent().  GPS, serial data, CAN events and some others are handled directly from the main loop.  This is shown in the figure below.  Figure 12-20:  Turnkey main task loop  We have seen in the Turnkey application how processEvent() handles a power-on sequence.    Depending on the settings of the configuration parameters, it initializes the satellite and GPRS modules, starts the GPS and sets timers to check for GPS and to transmit message timeouts.  There is a single TIMER event which occurs when any of the timers has a timeout.  Depending on the timer that expired, Turnkey may build and send a message, or it may check for a received message (from GPRS) or process a timeout from the GPS process.    Other events are triggered, for example, when: •  DTR changes state •  a satellite or GPRS goes in or out of view •  a message is received.  The complete list of events is discussed in Chapter 14.
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 84 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) 12.3  QuickStart application The QuickStart application provides the minimum framework to build a custom application on the Q4000/QPRO.  It starts the main application task and lists the events used by the foundation to signal actions to the application.  1.  Close any APL.c file that is still open before opening the QuickStart APL.c, in order to avoid the confusion of having two APL.c files open at the same time.    2.  Select the QuickStart Workspace from the drop-down list at the top left-hand corner of the IDE screen.  This will cause the Turnkey group to be grayed out, and the QuickStart group will become bright yellow.    Figure 12-21:  Selecting the QuickStart Workspace  3.  Open APL.c from the QuckStart application.
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 85 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) As seen in Figure 12-22, the QuickStart APL.c contains little code under most of the event cases in the switch statement in processEvent(). This allows the user to fill in the event cases with customized code.  Figure 12-22:  QuickStart switch statement  The instructions for building, loading and executing the code are the same as in Section 12, except that after building the application, the executable bin file is: …/QuickStart/exe/QuickStart.bin.  Since QuickStart is simply a template and is included as a starting point for a user’s custom application, no examples of running the QuickStart application will be shown. 12.4  DemoApp applications To run the DemoApps, close any open APL.c files and select the DemoAppXXX application on the IAR IDE.  Open APL.c under DemoAppXXX. The applications are described in the following sections.
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 86 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) 12.4.1  DemoAppGSM DemoAppGSM sets a timer to first send out a short message via GSM and then sets a timer to send out a short report via satellite.  It uses network-specific calls to do this.  It continues to alternate between GSM and satellite messages until the application is stopped.  The timers are hardcoded to 60 seconds and are not adjustable from any program parameters.  1.  Select the DemoAppGSM Workspace from the drop-down list at the top, left-hand corner of the IAR IDE screen.  Open the APL.c file, as shown below:  Figure 12-23:  DemoAppGSM -  Selecting the Workspace  2.  Now build, load and execute DemoAppGSM.  The instructions for building, loading and executing the code are the same as in Section 12, except that after building the application, the executable bin file is: …/DemoAppGSM/exe/xxx-DemoAppGSM.bin.
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 87 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) 3.  After startup, check the Logger output for the line APL DEMO: GSM then Orbcomm.  This indicates that the correct DemoApp is running.  Figure 12-24:  DemoAppGSM -  Logger output that DemoAppGSM is running
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 88 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) In the  POWER_ON, case statement, the application calls TIMER_setDuration() and sets it to expire after GSM_DEMO_GSM_TIMEOUT_SECS.  This causes a TIMER event to occur when the timer expires.  Figure 12-25:  DemoAppGSM -  Setting the timer
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 89 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) When the timer expires, the foundation code generates a TIMER event which triggers the application’s processEvent() function.  APL.c then executes the case TIMER in the EVENT switch.  There it checks the msgSentViaGSM flag to see if a message has been sent via the terrestrial network (GPRS).  If not, it reads the DIO’s and sends a message via the GSM/GPRS network.  It then resets the timer to expire after GSM_DEMO_GSM_TIMEOUT_SECS.  After the timer expires, if a message has been sent via GSM/GPRS, the application attempts to send the DIO message via the satellite network.  Figure 12-26:  DemoAppGSM -  Processing a timeout
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 90 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) The AUX port •maximum speed is 57600 bps. •may not be available on certain configurations of the Q4000/QPRO.  The Q4000/QPRO with Iridium or Inmarsat, for example, does not have the AUX port available. 12.4.2  DemoAppSERIAL This sample application demonstrates some of the Q4000/QPRO’s serial port and multitasking functionality.  DemoAppSerial may be used with either the AUX port, or the MTS or Logger port.  It is necessary to use a different method with the AUX port than with the MTS or Logger port.  DemoAppSerial first shows the use of the AUX port to send data.  Note that this sample application uses network-specific calls.     1.  Select the DemoAppSERIAL Workspace from the drop-down list at the top, left-hand corner of the IAR IDE screen.  Open the APL.c file, as shown below:  Figure 12-27:  DemoAppSERIAL -  Selecting the Workspace          Note:
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 91 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) 2.  Now build, load and execute DemoAppSERIAL.  The instructions for building, loading and executing the code are the same as in Section 12, except that after building the application, the executable bin file is: …/DemoAppSERIAL/exe/xxx-DemoAppSERIAL.bin.  3.  After startup, check the Logger output for the line APL DEMO: Serial Port.  This indicates that the correct DemoApp is running.    Figure 12-28:  DemoAppSERIAL -  Logger output that DemoAppSERIAL is running  4.  It is necessary to open a Terminal Emulation program window to access the AUX port for this example.  Ensure that the port is set to:  Baud rate:   115200 bps Data bits:   8 Parity:   None Stop bits:   1 Flow control:   None  12.4.2.1 Receiving data from the AUX port DemoAppSERIAL spawns a task to check for data on the AUX port and echoes the data back to the AUX port as it is printed.  As soon as ten characters or a carriage return have been received,
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 92 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) the data are ready to be processed.  When the Serial Port example begins, APL.c waits for data to be input to the AUX port.  As it is typed in, it is echoed back to the port.  The application waits for ten seconds, ten characters to be input, or a carriage return to be entered.  Once any of those conditions occur, the modem sends the string via either satellite or GSM/GPRS to the configured address.  The string “Testing the AUX port” was entered below.  Figure 12-29:  DemoAppSERIAL -  AUX output of user message
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 93 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) 12.4.2.2 Receiving data from the MTS or Logger port DemoAppSERIAL demonstrates how to receive data from the AUX port.  In order to also receive data from either the Logger or MTS port, it is necessary to set the serial port mode in the application.  There are two options for port mode: PORT_MODE_PROTOCOL and PORT_MODE_APL. •  PORT_MODE_APL passes all serial port data to the application. •  PORT_MODE_PROTOCOL gathers bytes together in packets, passes them to all foundation tasks and then to the application.  This mode is preferred to allow OSI packet processing and special character trapping.  The following describes how the application is set up to receive data from the MTS port:  1.  In Figure 12-30, the MTS port mode is set to PORT_MODE_PROTOCOL on line 916.  Figure 12-30:  DemoAppSERIAL -  Setting serial port mode
  User Guide to Q4000/QPRO    Document Number 1135-4713   Rev G THIS  DOCUMENT  CONTAINS  CONFIDENTIAL  AND  PROPRIETARY  INFORMATION  OF  QUAKE  GLOBAL  CORPORATION.    IT  MAY  BE  USED  BY RECIPIENT ONLY FOR THE PURPOSE FOR WHICH IT WAS TRANSMITTED AND WILL BE RETURNED UPON REQUEST OR WHEN NO LONGER NEEDED BY RECIPIENT.    DISCLOSURE  TO  UNAUTHORIZED  THIRD  PARTIES  OR  DUPLICATION  WITHOUT  THE  EXPRESS  WRITTEN  PERMISSION OF  QUAKE GLOBAL IS PROHIBITED. Page 94 CONFIDENTIAL Information classified Confidential - Do not copy (See last page for obligations) 2.  Figure 12-31 shows that in the main processing loop, a callback function, checkSerRxData(), is called when serial port data are received (case  APL_SERRXDATA_MSG).  Figure 12-31:  DemoAppSERIAL -  Setting serial data callback function

Navigation menu