Old revisions Add to book Export to PDF Table of Contents Control API executeOutputAction Parameters Return Code executeLedAction Parameters Return Code setEthernetConfig Parameters Return Code openRS232 Parameters Return Code closeRS232 Return Code readRS232 Parameters Return Code writeRS232 Parameters Return Code Book Creator Add this page to your book Book Creator Remove this page from your book Manage book (0 page(s)) Help Control API executeOutputAction Controls the output signal (relay) of the device. int executeOutputAction(Channel channel, Relay relay) Parameters channel: relay channel (0–1) relay: output signal information Refer to Channel Enumerator Refer to Relay Enumerator Return Code Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs. executeLedAction Controls the LED of the device. int executeLedAction(LedColor color) Parameters color: LED color Refer to LedColor Enumerator Return Code Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs. setEthernetConfig Sets the Ethernet information. int setEthernetConfig(boolean enableDHCP, String ip, String subnet, String gateway, String dnsServer) Parameters enableDHCP: Decides whether to use DHCP. ip: IP address assigned to the device. subnet: Subnet mask of the device. gateway: IP address of the gateway. dnsServer: DNS server address. Return Code Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs. The API will return immediately upon starting the Ethernet setting, the result will be passed on to the onActivityResult. openRS232 Open RS-232 serial port. int openRS232(int baudrate) Parameters baudrate: The RS-232 communication speed. Return Code Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs. closeRS232 Close RS-232 serial port. int closeRS232() Return Code Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs. readRS232 Read RS-232 data. int readRS232(RS232Data data) Parameters data: RS-232 data. Refer to RS232Data Class Return Code Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs. writeRS232 Send RS-232 data. int writeRS232(RS232Data data) Parameters data: RS-232 data. Refer to RS232Data Class Return Code Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.