Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Designing an Appliqué Sensor (AS), Rev 0.35 ASIM Messaging Interface Overview In the General Satellite Network Model description (A General Satellite Data Model.doc), a Sensor Node (SN) resides on the general routing network and participates in the SDM or high-speed network. It is envisioned however, that in the first generation of the model the Sensor Node will be composed of a set of Applique Sensor Interface Modules (ASIM) connected to a Sensor Manager (SM) using SPA-U interface. The Sensor Manager will then connect to the general high-speed (SpaceWire, Ethernet, etc.) routing network and serve as a gateway for sensors into the SDM. The following diagram is collectively referred to as a Sensor Node: sensor ASIM sensor ASIM USB SM High-speed routable network sensor ASIM The purpose of sub-dividing a Sensor Node into AS and SMIM components is to simplify the development of Appliqué Sensors. It is envisioned that an ASIM can be constructed using a single chip microcontroller such as the Silicon Labs C8051F320 which provides a full USB interface and sufficient flash program memory to interface to sensor devices and communicate with the Sensor Manager. It also provides a wide variety of digital and analog ports to support specific interfacing to sensor devices. All network communications and participation in the data model of the General Satellite Network Model is handled by the Sensor Manager. A simple messaging protocol between the ASIM and the Sensor Manager is defined within this document. A developer of an ASIM must produce two components: First, the ASIM firmware code and second, the xTEDS document for attached sensors. Both components must reside within AS non-volatile memory. (The xTEDS document is covered elsewhere.) ASIM code must be able to control attached sensors and respond to commands from the Sensor Manager. This document is concerned with requirements of the AS code needed to interface with the Sensor Manager. As such, this document should be viewed as an Interface Control Document (ICD) for connecting an ASIM to the Sensor Manager network. This document does not address the interface between the ASIM and actual sensor(s) which is left to the discretion of the sensor/ASIM designer. A. Message syntax Each command arriving from the Sensor Manager will require either a single message response or initiate a stream of responses. Messages consist of three (3) fields: Command, Length, and Data. The first byte is the Command, consisting of a single upper-case ASCII character. Length consists of a 16-bit (2 byte) unsigned integer Cmd 0 Data… Length 1 2 3 … (bytes) representing the number of data bytes. Data bytes are raw byte values. The maximum length of a command message (from the Sensor Manager) is 64 bytes. The maximum length of a response message (from the ASIM) is 16k bytes. The length field is most-significant-byte-first. A. 1 Command messages The following commands from the Sensor Manager are defined. Some commands may have no effect if not implemented on a given ASIM (such as Subsystem Control or Device Control). Regardless, every command should generate a response. A.1.1 Initialize (I) Perform any required initialization operations for the sensor(s). This command will always be given immediately following a power on command. Length field is always 0. Reply expected: Status (S) A.1.2 Reset (R) Perform a reset of the sensor device(s) (if defined), perform a warm boot reset of the ASIM code, and clear the status word. This command will be given following the detection of an anomalous communication or activity. Length field is always 0. Reply expected: Status (S) A.1.3 Self test (T) Perform a self-test of the sensor device(s) and AS controller. Length field is always 0. Reply expected: Status (S) A.1.4 Request data message (M) Request for a data message where length is always 7: and data is a message ID byte (0..255) as defined in the xTEDS document, followed by an IP address (4 bytes) and a port number (2 bytes). Reply expected: Data (D) or Status (S) if request cannot be honored. SPECIAL CASE: If a data message is specified in xTEDS as having an external source (SOURCE=”EXTERNAL”), no reply is expected directly from the ASIM. The ASIM is responsible for commanding the external device to provide the appropriate data message(s) through another network connection. If the associated message is specified in xTEDS as a polled (DATARATE="Polled") message, this request will result in a single Data (D) reply. If the associated message is specified in xTEDS as a stream (DATARATE="Stream") message, this request will result in a continuous stream of Data (D) replies at the rate chosen by the ASIM. In this case, the message stream must be cancelled with a Cancel (C) command (see A.1.4b). If a message is not defined as either polled or stream in the xTEDS, the default is polled. A.1.4b Cancel requested data message stream (C) Cancel a previous data message stream. Length is always 1, data is a message ID byte. (If no current message stream is associated with this message ID from a previous Request (M) message, this command has no effect. A.1.4c Request a counted data message stream (N) Request for a data message where length is always 5: The first data byte is the message ID as defined in the xTEDS document. The remaining 4 data bytes constitute an unsigned 32-bit count. Reply expected: Data (D) or Status (S) if request cannot be honored. If the associated message is specified in xTEDS as a polled message, this request will result in a single Data (D) reply regardless of the given count. If the associated message is specified in xTEDS as a stream message, this request will result in a continuous stream of Data (D) replies at the rate chosen by the ASIM for the requested count. In this case, the message stream will automatically cancel after the count is reached and the Cancel (C) command is not required. However, the Cancel (C) command can be utilized to prematurely cancel or abort a counted data message stream. A.1.5 Power on (P) Power up sensor device(s) to operational mode. Note that only one power-on command is available. If an AS hosts more than one device, individual devices are expected to be controlled using Subsystem and Device commands. Length field is always 0. Reply expected: Status (S) A.1.6 Power down (F) Power down sensor device(s) to idle mode. Note that only one power-on command is available. If an AS hosts more than one device, individual devices are expected to be controlled using Subsystem and Device commands. Length field is always 0. Reply expected: Status (S) A.1.7 Request Version (U) Request the version number of this ASIM Command Interpreter. Length field is always 0. Reply expected: Version(V). A.1.8 Command Message (V) Device command message. In this command, length is the length of the command message. Here data consists of the message name (8 bytes) followed by parameter bytes as defined in the xTEDS document. If a command message has no parameter bytes, the length will be 8. Reply expected: Status (S). A.1.9 Read xTEDS (X) Read xTEDS. Length field is always 0. Reply expected: xTEDS (X) or Status (S) if the request cannot be honored. A.1.10 Time at the Tone (O) The time at the next sync pulse is given in the data field in 8 bytes: time(sec) (4 bytes) + time (usec) (4 bytes). When the next sync is received the current time is to be replaced with the time at the tone. Length field is always 8. Reply expected: Status(S). A.1.11 Development (>0x8F) These command code values are reserved for sensor developers and will not be used in future expansions of the ASI. A.2 Response messages A message command field used in an ASIM response consists of a single upper-case letter. The following commands are defined; A.2.1 Status (S) A status reply contains an 8-bit (one byte) status word. In this message, length is always 1. A.2.2 Data (D) In a data reply, length is the length of the data reply message plus one byte and data represents two components: The first data byte is the message ID (0..255). The remaining message content is as defined in the xTEDS definition for the message. For example, if an xTEDS-defined message consists of 8 data bytes, the length field of this reply would be 9 bytes; one byte for the message ID and 8 data bytes. A.2.3 xTEDS (X) In an xTEDS reply, length is the byte length of the xTEDS document and data represents the text of the entire document. A.2.4 Version (V ) Aversion reply contains an 8-bit (one byte) version. In this message, length is always 1. B. Message timeouts The Sensor Manager will expect a reply to a command message within TBD seconds. If a reply times out, the Sensor Manager will issue a Reset (R) message. If two successive Reset messages time out, the Sensor Manager will abandon the AS and ignore any further communications. C. Status An 8-bit status word must be maintained by the AS. Bit description 0 (MSB) Error (OR of bits 1, 2) 1 Illegal or unrecognized command. (Cleared upon transmission) 2 Self-test failure. (Cleared upon transmission) 3 Mode (0 for idle, 1 for operation) 4 (available) 5 (available) 6 (available) 7 (LSB) (available)