PROT

Description

Sets the active I/O interface. PROT must be called with one or two arguments. The second argument is optional. Please see below.

Parameters

1) First argument: Data Interface.Allowed values are:

RS232 (RS232 Interface)

I2C (I2C bus - Avisaro is slave device)

SPI (SPI bus - Avisaro is slave device)

CAN (CAN bus)

SOCK (TCP/IP socket - Avisaro is listening)

NONE (I/O is disabled)

FILE (Output is written to file 'outfile.log' " (MehrDetails)

2) Second argument (Optional)

NOW
Optional argument to make changes immediately, but not permanently. With "NOW" the module immediately switches over to the new protocol without storing anything in Flash Memory. Without "NOW" only a DataFlash entry is changed. A restart is necessary to activate the new protocol.

Return Value

ERR_OK (0) if command was accepted
ERR_ARGUMENT (4) if one or more arguments didn't match.

Example

PROT SPI

Sets the active I/O interface to SPI, which will be used after next reboot

Remarks

The secondary I/O channels, such as CAN#2 and RS232#2 cannot be used as primary I/O interface. They can only be used from the scripting language.