Contents

Additional functions of the library

Additional functions of the RemoteXY library allow you to control operating modes and get current statuses.


IsConnected

Description

uint8_t RemoteXY_isConnected ()

Returns the status of a connection to a smartphone. Lets you know if the smartphone is connected to the board or not.

Return values

1 if connection established or 0 if no

Examples


int state = RemoteXY_isConnected();

sendInputVariables

Description

void RemoteXY_sendInputVariables ()

Sets the RemoteXY library in the mode of sending input variables to the graphical interface. The function allows you to change the state of the control elements in the graphical interface, the data from which is always transmitted from the graphical interface to the device. This is non-blocking function, variables will be transferred in the background. When this function is called, the transfer of all data is suspended until the input variables are transferred to the graphical interface. You can check if the variables are sent using function didSendInputVariables.

IMPORTANT. You cannot call this function in every loop. If this is done, the data transfer will be completely stopped. The function should be called only when it becomes necessary to change the state of the control element or several elements in the graphical interface. Before calling this function, set the necessary data into the input variables of the RemoteXY structure.

Examples


RemoteXY.switch_1 = 1;
RemoteXY_sendInputVariables ();

didSendInputVariables

Description

uint8_t RemoteXY_didSendInputVariables ()

Checks whether the input variables were transferred to the graphical interface after calling sendInputVariables.

Return values

1 if input variables are transferred and communication is restored, 0 input variables are in the process of transmission.

Examples


int state = RemoteXY_didSendInputVariables ();