![]() |
ModelSpace
Documentation for ModelSpace models and classes.
|
Holds all os-specific interfaces. More...
#include <OS.h>
Public Member Functions | |
| OS () | |
| virtual | ~OS () |
| virtual int16 | startup () |
| Initialize the os. More... | |
| virtual clockwerk::Time | systemTime () |
| Retrieves the system base time. More... | |
| virtual clockwerk::Time | navigationTime () |
| Retrieves the system navigation time. More... | |
| virtual int16 | delay (const clockwerk::Time &delay_time) |
| Retrieves a handle to the system base time. More... | |
| virtual int16 | sysLog (double sys_time, const char *app, const char *message, uint16 msg_size) |
| Write a system log (or terminal output, or file) More... | |
| virtual int32 | openFile (const char *filename) |
| Opens a file with the specified filename. More... | |
| virtual int16 | closeFile (int32 fd) |
| Close the file at the file descriptor. More... | |
| virtual int16 | writeFile (int32 fd, const char *buffer, uint32 size) |
| Writes data to an open file. More... | |
| virtual uint32 | readFile (int32 fd, char *buffer, int32 size) |
| Reads data from an open file. More... | |
| virtual int32 | openBroadcastSocket () |
| Opens a broadcast socket for sending data. More... | |
| virtual int16 | sendBroadcastSocket (int32 sock_fd, const char *address, uint32 port, const char *buffer, uint32 len) |
| Sends data over a broadcast socket. More... | |
| virtual int32 | openListenerSocket (const char *address, uint32 port) |
| Opens a listener socket to receive data. More... | |
| virtual uint32 | readListenerSocket (int32 sock_fd, char *buffer, uint32 max_len) |
| Reads data from a listener socket. More... | |
Holds all os-specific interfaces.
The OS class is the cFS++ method for applying the OSAL, or Operating System Abstraction Layer. OS defines all basic interfaces which are typical of an os, such as file I/O, thread scheduling, etc.
The OS class by itself does not do anything. Users seeking to implement OS should create a child class with OS as its base and implement the functions documented herein.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Close the file at the file descriptor.
| fd | The file to close |
|
inlinevirtual |
Retrieves a handle to the system base time.
Returns a pointer to the current system time in the form provided by the clockwerk::Time class.
|
inlinevirtual |
Retrieves the system navigation time.
The navigation time is a universally achored form of time which is synchronized between the flight vehicle and some ground reference. Often used timesets include GPS time and UTC time. Though the specific implementation varies system-to-system, these are generally stable forms of time, whereas system time may drift over long periods.
|
inlinevirtual |
Opens a broadcast socket for sending data.
This function creates and opens a socket that can be used to send broadcast messages over the network.
|
inlinevirtual |
Opens a file with the specified filename.
| filename | The name of the file to open. |
|
inlinevirtual |
Opens a listener socket to receive data.
Creates and binds a socket to the specified address and port for listening to incoming data.
| address | The address to bind the listener socket to. |
| port | The port number to bind the listener socket to. |
|
inlinevirtual |
Reads data from an open file.
| fd | The file descriptor of the open file. |
| buffer | Pointer to the buffer where read data will be stored. |
| size | The number of bytes to read into the buffer. |
|
inlinevirtual |
Reads data from a listener socket.
Reads up to max_len bytes from the specified listener socket into the provided buffer.
| sock_fd | The file descriptor of the listener socket. |
| buffer | Pointer to the buffer where the received data will be stored. |
| max_len | The maximum number of bytes to read into the buffer. |
|
inlinevirtual |
Sends data over a broadcast socket.
Sends the specified buffer to the given address and port using the provided broadcast socket.
| sock_fd | The file descriptor of the broadcast socket. |
| address | The destination address to send the broadcast to. |
| port | The destination port number. |
| buffer | Pointer to the data buffer to send. |
| len | The number of bytes to send from the buffer. |
|
inlinevirtual |
Initialize the os.
|
inlinevirtual |
Write a system log (or terminal output, or file)
| sys_time | The time for the log |
| app | The name of the app to log |
| message | The message to write |
| msg_size | The size of the message to write |
|
inlinevirtual |
Retrieves the system base time.
System base time is a specialized form of time which typically runs on the system oscillator (although the exact details are implementation-specific). System time should be used for low-level utilities, which may range from the scheduler step rate to timing. For utilties which require a universally anchored time, navigationTime() should be used instead.
|
inlinevirtual |
Writes data to an open file.
| fd | The file descriptor of the open file. |
| buffer | Pointer to the data buffer to write. |
| size | The number of bytes to write from the buffer. |