## 4 Description of the System
### Incorporation of New Components
#### 4.2.3 Communication System  
OBC is integrated into the vehicle infrastructure by RS485 asynchronous communication. RS485 series communication is appropriate for environments that require robustness despite adverse electrical conditions, which may be the case in a public-transit bus. Communication between the OBC and the vehicle infrastructure is achieved by a protocol governed by a component of the vehicle infrastructure--typically the driver console--which assumes the role of master node (MN) of the bus in RS485 communication, with the OBC as the slave node (SN) of this communication. The general format of the data packets exchanged between the nodes is described in Table 2, and the meaning of the fields is shown in Table 4.  
Figure 4: Camera (**right**) and mechanism of attachment to the body of the vehicle (**left**). In the context of distributed computing systems, this integration of the proposed system into the existing infrastructure via the communication system is termed a weak-coupling scheme. The advantage of this coupling scheme, as compared to the alternative--Strong coupling--Is that it affects the operation of existing infrastructure elements very little. Specifically, the existing infrastructure will only be affected by the need to incorporate the software module into the MN, which handles the communication protocol. With the objective of deploying a local wireless network in each vehicle, the communications system has a Wi-Fi access point. The OBC and the mobile devices of travelers that execute the route assistant will be connected to this local network. The control of the flow of data packets of the protocol is simple. When the MN of the infrastructure sends a data packet, it awaits the response of the SN for a maximum of 200 ms.  
* If this length of time passes without a response, then the message is repeated for a maximum number of tries (NT). If the value of NT is attained, the infrastructure assumes a failure in the system and a record and notification of this incident is generated. * A response is received from the SN; if the STATUS field of the received packet as a value of 6 and the SEC-NUM field coincides with the transmitted packet, the packet has been correctly received by the SN. If the received packet contains a value of 7 in the STATUS field, it indicates that the packet with the number sequence equal to the SEC-NUM field has been received with errors, which causes the MN to resend the packet. \begin{table}
\begin{tabular}{c c c} \hline
**Field** & **Length** & **Description** \\ \hline STX & 1 byte & Start of O\(\times\)FF data packet \\ \hline \multirow{3}{*}{SRC-ADD} & \multirow{3}{*}{1 byte} & Identifier of origin node: \\  & & 0: Master node. \\  & & 1: OBC. \\ \hline \multirow{3}{*}{DST-ADD} & \multirow{3}{*}{1 byte} & Identifier of destination node: \\  & & 0: Master node (MN). \\  & & 1: Slave node (SN). \\ \hline SEC-NUM & 1 byte & Packet sequence number: 0–255 \\ \hline \multirow{9}{*}{STATUS} & \multirow{9}{*}{1 byte} & State of infrastructure/vehicle operation: \\  & & 0: Infrastructure out of service. \\  & & 1: Error in the infrastructure. \\  & & 2: Vehicle out of service. \\  & & 3: Line in service state. \\  & & 4: End of line service. \\  & & 5: Forced termination of communication with infrastructure. \\  & & 6: Packet correctly received. \\  & & 7: Erroneous data packet. \\ \hline DATA-LEN & 1 byte & Number of bytes in the data field. \\ \hline \multirow{3}{*}{DATA} & Value of the \\  & DATA\_LEN field & Data field whose structure is dependent on the status (STATUS field). \\ \hline CHK & 1 byte & Byte of checksum for error control in the data packet. \\ \hline \end{tabular}
\end{table} 
Table 4: Description of fields from the data frame. The mobile devices of users are connected to the OBC via Wi-Fi using the User Datagram Protocol (UDP) protocol.