Extended API module
Contents
- Reference
Files
- file apix.h
RTOS Facilities
- using queue_t = void*
- Unblocks a task in the Blocked state (e.g.
- using sem_t = void*
- Unblocks a task in the Blocked state (e.g.
-
bool task_abort_delay(task_
t task) - Unblocks a task in the Blocked state (e.g.
-
void task_notify_when_deleting(task_
t target_task, task_ t task_to_notify, uint32_t value, notify_action_e_t notify_action) - Notify a task when a target task is being deleted.
-
mutex_
t mutex_recursive_create(void) - Creates a recursive mutex which can be locked recursively by the owner.
-
bool mutex_recursive_take(mutex_
t mutex, uint32_t timeout) - Takes a recursive mutex.
-
bool mutex_recursive_give(mutex_
t mutex) - Gives a recursive mutex.
-
task_
t mutex_get_owner(mutex_ t mutex) - Returns a handle to the current owner of a mutex.
-
sem_
t sem_create(uint32_t max_count, uint32_t init_count) - Creates a counting sempahore.
-
void sem_delete(sem_
t sem) - Deletes a semaphore (or binary semaphore)
-
sem_
t sem_binary_create(void) - Creates a binary semaphore.
-
bool sem_wait(sem_
t sem, uint32_t timeout) - Waits for the semaphore's value to be greater than 0.
-
bool sem_post(sem_
t sem) - Increments a semaphore's value.
-
uint32_t sem_get_count(sem_
t sem) - Returns the current value of the semaphore.
-
queue_
t queue_create(uint32_t length, uint32_t item_size) - Creates a queue.
-
bool queue_append(queue_
t queue, const void* item, uint32_t timeout) - Posts an item to the front of a queue.
-
bool queue_peek(queue_
t queue, void*const buffer, uint32_t timeout) - Receive an item from a queue without removing the item from the queue.
-
bool queue_recv(queue_
t queue, void*const buffer, uint32_t timeout) - Receive an item from the queue.
-
uint32_t queue_get_waiting(const queue_
t queue) - Return the number of messages stored in a queue.
-
uint32_t queue_get_available(const queue_
t queue) - Return the number of spaces left in a queue.
-
void queue_delete(queue_
t queue) - Delete a queue.
-
void queue_reset(queue_
t queue) - Resets a queue to an empty state.
Device Registration
- int registry_bind_port(uint8_t port, v5_device_e_t device_type)
- Registers a device in the given zero-indexed port.
- int registry_unbind_port(uint8_t port)
- Deregisters a devices from the given zero-indexed port.
- v5_device_e_t registry_get_bound_type(uint8_t port)
- Returns the type of device registered to the zero-indexed port.
- v5_device_e_t registry_get_plugged_type(uint8_t port)
- Returns the type of the device plugged into the zero-indexed port.
Filesystem
- int32_t fdctl(int file, const uint32_t action, void*const extra_arg)
- Control settings of the serial driver.
- int32_t motor_set_reversed(int8_t port, const bool reverse)
- Sets the reverse flag for the motor.
- int32_t motor_is_reversed(int8_t port)
- Gets the operation direction of the motor as set by the user.
- #define SERCTL_ACTIVATE
- Action macro to pass into serctl or fdctl that activates the stream identifier.
- #define SERCTL_DEACTIVATE
- Action macro to pass into serctl or fdctl that deactivates the stream identifier.
- #define SERCTL_BLKWRITE
- Action macro to pass into fdctl that enables blocking writes for the file.
- #define SERCTL_NOBLKWRITE
- Action macro to pass into fdctl that makes writes non-blocking for the file.
- #define SERCTL_ENABLE_COBS
- Action macro to pass into serctl that enables advanced stream multiplexing capabilities.
- #define SERCTL_DISABLE_COBS
- Action macro to pass into serctl that disables advanced stream multiplexing capabilities.
- #define DEVCTL_FIONREAD
- Action macro to check if there is data available from the Generic Serial Device.
- #define DEVCTL_FIONWRITE
- Action macro to check if there is space available in the Generic Serial Device's output buffer.
- #define DEVCTL_SET_BAUDRATE
- Action macro to set the Generic Serial Device's baudrate.
Function documentation
bool task_abort_delay(task_ t task)
#include <pros/apix.h>
Unblocks a task in the Blocked state (e.g.
Parameters | |
---|---|
task | The task to unblock |
Returns | True if the task was unblocked, false otherwise |
waiting for a delay, on a semaphore, etc.).
Example:
task_t task = task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn"); task_delay(1000); // in another task somewhere else, this will abort the task_delay bove: task_abort_delay(task);
void task_notify_when_deleting(task_ t target_task,
task_ t task_to_notify,
uint32_t value,
notify_action_e_t notify_action)
#include <pros/apix.h>
Notify a task when a target task is being deleted.
Parameters | |
---|---|
target_task | The task being watched for deletion |
task_to_notify | The task to notify when target_task is deleted |
value | The value to supply to task_notify_ext |
notify_action | The action to supply to task_notify_ext |
Example:
task_t task_to_delete = task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn"); task_t task_to_notify = task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn2"); task_notify_ext(task_to_notify, 0, NOTIFY_ACTION_INCREMENT, NULL); task_notify_when_deleting(task_to_delete, task_get_current(), 0, NOTIFY_ACTION_NONE); task_delete(task_to_delete);
mutex_ t mutex_recursive_create(void)
#include <pros/apix.h>
Creates a recursive mutex which can be locked recursively by the owner.
Returns | A newly created recursive mutex. |
---|
Example:
mutex_t mutex = mutex_recursive_create(); void task_fn(void* param) { while(1) { mutex_recursive_take(mutex, 1000); // critical section mutex_recursive_give(mutex); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn");
bool mutex_recursive_take(mutex_ t mutex,
uint32_t timeout)
#include <pros/apix.h>
Takes a recursive mutex.
Parameters | |
---|---|
mutex | A mutex handle created by mutex_recursive_create |
timeout | |
Returns | 1 if the mutex was obtained, 0 otherwise |
Example:
mutex_t mutex = mutex_recursive_create(); void task_fn(void* param) { while(1) { mutex_recursive_take(mutex, 1000); // critical section mutex_recursive_give(mutex); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn");
bool mutex_recursive_give(mutex_ t mutex)
#include <pros/apix.h>
Gives a recursive mutex.
Parameters | |
---|---|
mutex | A mutex handle created by mutex_recursive_create |
Returns | 1 if the mutex was obtained, 0 otherwise |
Example:
mutex_t mutex = mutex_recursive_create(); void task_fn(void* param) { while(1) { mutex_recursive_take(mutex, 1000); // critical section mutex_recursive_give(mutex); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn");
task_ t mutex_get_owner(mutex_ t mutex)
#include <pros/apix.h>
Returns a handle to the current owner of a mutex.
Parameters | |
---|---|
mutex | A mutex handle |
Returns | A handle to the current task that owns the mutex, or NULL if the mutex isn't owned. |
Example:
mutex_t mutex = mutex_create(); void task_fn(void* param) { while(1) { mutex_take(mutex, 1000); // critical section mutex_give(mutex); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn"); void opcontrol(void) { while (1) { if (joystick_get_digital(1, 7, JOY_UP)) { task_t owner = mutex_get_owner(mutex); if (owner != NULL) { printf("Mutex is owned by task %s", task_get_name(owner)); } else { printf("Mutex is not owned"); } } task_delay(20); } }
sem_ t sem_create(uint32_t max_count,
uint32_t init_count)
#include <pros/apix.h>
Creates a counting sempahore.
Parameters | |
---|---|
max_count | The maximum count value that can be reached. |
init_count | The initial count value assigned to the new semaphore. |
Returns | A newly created semaphore. If an error occurred, NULL will be returned and errno can be checked for hints as to why sem_create failed. |
Example:
// Binary semaphore acts as a mutex sem_t sem = sem_create(1, 0); void task_fn(void* param) { while(1) { sem_take(sem, 1000); // critical section sem_give(sem); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn");
void sem_delete(sem_ t sem)
#include <pros/apix.h>
Deletes a semaphore (or binary semaphore)
Parameters | |
---|---|
sem | Semaphore to delete |
Example:
// Binary semaphore acts as a mutex sem_t sem = sem_create(1, 0); void task_fn(void* param) { while(1) { sem_take(sem, 1000); // critical section sem_give(sem); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn"); void opcontrol(void) { while (1) { if (joystick_get_digital(1, 7, JOY_UP)) { // honestly this is a bad example because you should never // delete a semaphore like this sem_delete(sem); } task_delay(20); } }
sem_ t sem_binary_create(void)
#include <pros/apix.h>
Creates a binary semaphore.
Returns | A newly created semaphore. |
---|
Example:
// Binary semaphore acts as a mutex sem_t sem = sem_binary_create(); void task_fn(void* param) { while(1) { sem_take(sem, 1000); // critical section sem_give(sem); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn");
bool sem_wait(sem_ t sem,
uint32_t timeout)
#include <pros/apix.h>
Waits for the semaphore's value to be greater than 0.
Parameters | |
---|---|
sem | Semaphore to wait on |
timeout | Time to wait before the semaphore's becomes available. A timeout of 0 can be used to poll the sempahore. TIMEOUT_MAX can be used to block indefinitely. |
Returns | True if the semaphore was successfully take, false otherwise. If false is returned, then errno is set with a hint about why the sempahore couldn't be taken. |
If the value is already greater than 0, this function immediately returns.
Example:
// Binary semaphore acts as a mutex sem_t sem = sem_create(1, 0); void task_fn(void* param) { while(1) { if(!sem_wait(sem, 1000)) { printf("Failed to take semaphore"); task_delay(1000); continue; } // critical section sem_give(sem); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn"); void opcontrol(void) { while (1) { if (sem_wait(sem, 0))) { printf("Semaphore is available"); } task_delay(20); } }
bool sem_post(sem_ t sem)
#include <pros/apix.h>
Increments a semaphore's value.
Parameters | |
---|---|
sem | Semaphore to post |
Returns | True if the value was incremented, false otherwise. If false is returned, then errno is set with a hint about why the semaphore couldn't be taken. |
Example:
// Binary semaphore acts as a mutex sem_t sem = sem_create(1, 0); void task_fn(void* param) { while(1) { sem_post(sem); // increments, mimicking to "claim" // critical section sem_give(sem); task_delay(1000); } } task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn");
uint32_t sem_get_count(sem_ t sem)
#include <pros/apix.h>
Returns the current value of the semaphore.
Parameters | |
---|---|
sem | A semaphore handle |
Returns | The current value of the semaphore (e.g. the number of resources available) |
Example of sem_get_count:
// Binary semaphore acts as a mutex sem_t sem = sem_create(1, 0); printf("semaphore count: %d", sem_get_count(sem)); // semaphore count: 0 sem_take(sem, 1000); printf("semaphore count: %d", sem_get_count(sem)); // semaphore count: 1 sem_give(sem); printf("semaphore count: %d", sem_get_count(sem)); // semaphore count: 0
queue_ t queue_create(uint32_t length,
uint32_t item_size)
#include <pros/apix.h>
Creates a queue.
Parameters | |
---|---|
length | The maximum number of items that the queue can contain. |
item_size | The number of bytes each item in the queue will require. |
Returns | A handle to a newly created queue, or NULL if the queue cannot be created. |
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); int item[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; queue_prepend(queue, item, 1000); queue_append(queue, item, 1000); printf("queue length: %d", queue_get_length(queue)); }
bool queue_append(queue_ t queue,
const void* item,
uint32_t timeout)
#include <pros/apix.h>
Posts an item to the front of a queue.
Parameters | |
---|---|
queue | The queue handle |
item | A pointer to the item that will be placed on the queue. |
timeout | Time to wait for space to become available. A timeout of 0 can be used to attempt to post without blocking. TIMEOUT_MAX can be used to block indefinitely. |
Returns | True if the item was preprended, false otherwise. |
The item is queued by copy, not by reference.
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); int item[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; queue_prepend(queue, item, 1000); queue_append(queue, item, 1000); printf("queue length: %d", queue_get_length(queue)); } / bool queue_prepend(queue_t queue, const void* item, uint32_t timeout); /** * Posts an item to the end of a queue. The item is queued by copy, not by * reference. * * \param queue * The queue handle * \param item * A pointer to the item that will be placed on the queue. * \param timeout * Time to wait for space to become available. A timeout of 0 can be used * to attempt to post without blocking. TIMEOUT_MAX can be used to block * indefinitely. * * \return True if the item was preprended, false otherwise. * * \b Example: * \code * void opcontrol(void) { * queue_t queue = queue_create(10, sizeof(int)); * int item[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; * queue_prepend(queue, item, 1000); * queue_append(queue, item, 1000); * printf("queue length: %d", queue_get_length(queue)); * } *
bool queue_peek(queue_ t queue,
void*const buffer,
uint32_t timeout)
#include <pros/apix.h>
Receive an item from a queue without removing the item from the queue.
Parameters | |
---|---|
queue | The queue handle |
buffer | Pointer to a buffer to which the received item will be copied |
timeout | The maximum amount of time the task should block waiting for an item to receive should the queue be empty at the time of the call. TIMEOUT_MAX can be used to block indefinitely. |
Returns | True if an item was copied into the buffer, false otherwise. |
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); char* item = "Hello! this is a test"; queue_prepend(queue, item, 1000); queue_append(queue, item, 1000); char* recv = malloc(sizeof("Hello! this is a test")); queue_peek(queue, recv, 1000); printf("Queue: %s", recv); free(recv); }
bool queue_recv(queue_ t queue,
void*const buffer,
uint32_t timeout)
#include <pros/apix.h>
Receive an item from the queue.
Parameters | |
---|---|
queue | The queue handle |
buffer | Pointer to a buffer to which the received item will be copied |
timeout | The maximum amount of time the task should block waiting for an item to receive should the queue be empty at the time of the call. queue_ |
Returns | True if an item was copied into the buffer, false otherwise. |
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); char* item = "Hello! this is a test"; queue_prepend(queue, item, 1000); queue_append(queue, item, 1000); char* recv = malloc(sizeof("Hello! this is a test")); queue_recv(queue, recv, 1000); printf("Queue: %s", recv); free(recv); }
uint32_t queue_get_waiting(const queue_ t queue)
#include <pros/apix.h>
Return the number of messages stored in a queue.
Parameters | |
---|---|
queue | The queue handle. |
Returns | The number of messages available in the queue. |
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); int item[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; queue_prepend(queue, item, 1000); queue_append(queue, item, 1000); printf("queue waiting: %d", queue_get_waiting(queue)); }
uint32_t queue_get_available(const queue_ t queue)
#include <pros/apix.h>
Return the number of spaces left in a queue.
Parameters | |
---|---|
queue | The queue handle. |
Returns | The number of spaces available in the queue. |
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); int item[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; queue_prepend(queue, item, 1000); queue_append(queue, item, 1000); printf("queue available: %d", queue_get_available(queue)); }
void queue_delete(queue_ t queue)
#include <pros/apix.h>
Delete a queue.
Parameters | |
---|---|
queue | Queue handle to delete |
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); queue_delete(queue); }
void queue_reset(queue_ t queue)
#include <pros/apix.h>
Resets a queue to an empty state.
Parameters | |
---|---|
queue | Queue handle to reset |
Example:
void opcontrol(void) { queue_t queue = queue_create(10, sizeof(int)); int item[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; queue_prepend(queue, item, 1000); queue_append(queue, item, 1000); queue_reset(queue); }
int registry_bind_port(uint8_t port,
v5_device_e_t device_type)
#include <pros/apix.h>
Registers a device in the given zero-indexed port.
Parameters | |
---|---|
port | The port number to register the device |
device_type | |
Returns | 1 upon success, PROS_ERR upon failure |
Registers a device of the given type in the given port into the registry, if that type of device is detected to be plugged in to that port.
This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (0-20), or a a different device than specified is plugged in. EADDRINUSE - The port is already registered to another device.
Example:
void opcontrol(void) { registry_bind_port(1, E_DEVICE_MOTOR); }
int registry_unbind_port(uint8_t port)
#include <pros/apix.h>
Deregisters a devices from the given zero-indexed port.
Parameters | |
---|---|
port | The port number to deregister |
Returns | 1 upon success, PROS_ERR upon failure |
Removes the device registed in the given port, if there is one.
This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (0-20).
Example:
void opcontrol(void) { registry_bind_port(1, E_DEVICE_MOTOR); registry_unbind_port(1); }
v5_device_e_t registry_get_bound_type(uint8_t port)
#include <pros/apix.h>
Returns the type of device registered to the zero-indexed port.
Parameters | |
---|---|
port | The V5 port number from 0-20 |
Returns | The type of device that is registered into the port (NOT what is plugged in) |
This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (0-20).
Example:
void opcontrol(void) { registry_bind_port(1, E_DEVICE_MOTOR); printf("port 1 is registered to a motor: %d", registry_get_bound_type(1) == E_DEVICE_MOTOR); }
v5_device_e_t registry_get_plugged_type(uint8_t port)
#include <pros/apix.h>
Returns the type of the device plugged into the zero-indexed port.
Parameters | |
---|---|
port | The V5 port number from 0-20 |
Returns | The type of device that is plugged into the port (NOT what is registered) |
This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (0-20).
Example:
void opcontrol(void) { registry_bind_port(1, E_DEVICE_MOTOR); printf("port 1 is registered to a motor: %d", registry_get_plugged_type(1) == E_DEVICE_MOTOR); }
int32_t fdctl(int file,
const uint32_t action,
void*const extra_arg)
#include <pros/apix.h>
Control settings of the serial driver.
Parameters | |
---|---|
file | |
action | An action to perform on the serial driver. See the SERCTL_* macros for details on the different actions. |
extra_arg | An argument to pass in based on the action |
Example:
void opcontrol(void) { serctl(SERCTL_SET_BAUDRATE, (void*) 9600); } / int32_t serctl(const uint32_t action, void* const extra_arg); /* * Control settings of the microSD card driver. * * \param action * An action to perform on the microSD card driver. See the USDCTL_* macros * for details on the different actions. * \param extra_arg * An argument to pass in based on the action */ // Not yet implemented // int32_t usdctl(const uint32_t action, void* const extra_arg); /** * Control settings of the way the file's driver treats the file * * \param file * A valid file descriptor number * \param action * An action to perform on the file's driver. See the *CTL_* macros for * details on the different actions. Note that the action passed in must * match the correct driver (e.g. don't perform a SERCTL_* action on a * microSD card file) * \param extra_arg * An argument to pass in based on the action * * \b Example: * \code * void opcontrol(void) { * int32_t fd = open("serial", O_RDWR); * fdctl(fd, SERCTL_SET_BAUDRATE, (void*) 9600); * } *
int32_t motor_set_reversed(int8_t port,
const bool reverse)
#include <pros/apix.h>
Sets the reverse flag for the motor.
Parameters | |
---|---|
port | The V5 port number from 1-21 |
reverse | True reverses the motor, false is default |
Returns | 1 if the operation was successful or PROS_ERR if the operation failed, setting errno. |
This will invert its movements and the values returned for its position.
This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (1-21). ENODEV - The port cannot be configured as a motor
Example
void autonomous() { motor_set_reversed(1, true); printf("Is this motor reversed? %d\n", motor_is_reversed(1)); }
int32_t motor_is_reversed(int8_t port)
#include <pros/apix.h>
Gets the operation direction of the motor as set by the user.
Parameters | |
---|---|
port | The V5 port number from 1-21 |
Returns | 1 if the motor has been reversed and 0 if the motor was not reversed, or PROS_ERR if the operation failed, setting errno. |
This function uses the following values of errno when an error state is reached: ENXIO - The given value is not within the range of V5 ports (1-21). ENODEV - The port cannot be configured as a motor
Example
void initialize() { printf("Is the motor reversed? %d\n", motor_is_reversed(1)); // Prints "Is the motor reversed? 0" }
Typedef documentation
typedef void* queue_t
#include <pros/apix.h>
Unblocks a task in the Blocked state (e.g.
waiting for a delay, on a semaphore, etc.).
Example:
task_t task = task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn"); task_delay(1000); // in another task somewhere else, this will abort the task_delay bove: task_abort_delay(task);
typedef void* sem_t
#include <pros/apix.h>
Unblocks a task in the Blocked state (e.g.
waiting for a delay, on a semaphore, etc.).
Example:
task_t task = task_create(task_fn, (void*)"PROS", TASK_PRIORITY_DEFAULT, TASK_STACK_DEPTH_DEFAULT, "task_fn"); task_delay(1000); // in another task somewhere else, this will abort the task_delay bove: task_abort_delay(task);
Define documentation
#define SERCTL_ACTIVATE
#include <pros/apix.h>
Action macro to pass into serctl or fdctl that activates the stream identifier.
When used with serctl, the extra argument must be the little endian representation of the stream identifier (e.g. "sout" -> 0x74756f73)
#define SERCTL_DEACTIVATE
#include <pros/apix.h>
Action macro to pass into serctl or fdctl that deactivates the stream identifier.
When used with serctl, the extra argument must be the little endian representation of the stream identifier (e.g. "sout" -> 0x74756f73)
#define SERCTL_BLKWRITE
#include <pros/apix.h>
Action macro to pass into fdctl that enables blocking writes for the file.
The extra argument is not used with this action, provide any value (e.g. NULL) instead
#define SERCTL_NOBLKWRITE
#include <pros/apix.h>
Action macro to pass into fdctl that makes writes non-blocking for the file.
The extra argument is not used with this action, provide any value (e.g. NULL) instead
#define SERCTL_ENABLE_COBS
#include <pros/apix.h>
Action macro to pass into serctl that enables advanced stream multiplexing capabilities.
The extra argument is not used with this action, provide any value (e.g. NULL) instead
#define SERCTL_DISABLE_COBS
#include <pros/apix.h>
Action macro to pass into serctl that disables advanced stream multiplexing capabilities.
The extra argument is not used with this action, provide any value (e.g. NULL) instead
#define DEVCTL_FIONREAD
#include <pros/apix.h>
Action macro to check if there is data available from the Generic Serial Device.
#define DEVCTL_FIONWRITE
#include <pros/apix.h>
Action macro to check if there is space available in the Generic Serial Device's output buffer.
#define DEVCTL_SET_BAUDRATE
#include <pros/apix.h>
Action macro to set the Generic Serial Device's baudrate.
The extra argument is the baudrate.