Skip to content

Commit

Permalink
Update to ZSS 1.4.0
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
  • Loading branch information
cdjackson committed Jun 18, 2021
1 parent 7ac4312 commit 219a5c3
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import java.util.List;
import java.util.Map;

import org.openhab.core.thing.ThingTypeUID;
import org.openhab.binding.zigbee.console.ZigBeeConsoleCommandProvider;
import org.openhab.core.thing.ThingTypeUID;
import org.osgi.service.component.annotations.Component;

import com.zsmartsystems.zigbee.console.ZigBeeConsoleCommand;
Expand All @@ -32,8 +32,10 @@
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpConfigurationCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpCountersCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpPolicyCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpRoutingCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpScanCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpStateCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpTokenCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpValueCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleNcpVersionCommand;
import com.zsmartsystems.zigbee.console.ember.EmberConsoleSecurityStateCommand;
Expand All @@ -43,17 +45,19 @@
* This class provides ZigBee console commands for Ember dongles.
*
* @author Henning Sudbrock - initial contribution
* @author Chris Jackson - added commands
*/
@Component(immediate = true)
public class EmberZigBeeConsoleCommandProvider implements ZigBeeConsoleCommandProvider {

public static final List<ZigBeeConsoleCommand> EMBER_COMMANDS = unmodifiableList(
asList(new EmberConsoleMmoHashCommand(), new EmberConsoleNcpChildrenCommand(),
new EmberConsoleNcpConfigurationCommand(), new EmberConsoleNcpCountersCommand(),
new EmberConsoleNcpPolicyCommand(), new EmberConsoleNcpScanCommand(),
new EmberConsoleSecurityStateCommand(), new EmberConsoleNcpStateCommand(),
new EmberConsoleTransientKeyCommand(), new EmberConsoleNcpValueCommand(),
new EmberConsoleNcpVersionCommand()));
@SuppressWarnings("null")
public static final List<ZigBeeConsoleCommand> EMBER_COMMANDS = unmodifiableList(asList(
new EmberConsoleMmoHashCommand(), new EmberConsoleNcpChildrenCommand(),
new EmberConsoleNcpConfigurationCommand(), new EmberConsoleNcpCountersCommand(),
new EmberConsoleNcpPolicyCommand(), new EmberConsoleNcpScanCommand(), new EmberConsoleNcpRoutingCommand(),
new EmberConsoleNcpScanCommand(), new EmberConsoleSecurityStateCommand(), new EmberConsoleNcpStateCommand(),
new EmberConsoleNcpTokenCommand(), new EmberConsoleTransientKeyCommand(), new EmberConsoleNcpValueCommand(),
new EmberConsoleNcpVersionCommand()));

private Map<String, ZigBeeConsoleCommand> emberCommands = EMBER_COMMANDS.stream()
.collect(toMap(ZigBeeConsoleCommand::getCommand, identity()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.List;
import java.util.Map;

import org.openhab.core.thing.ThingTypeUID;
import org.openhab.binding.zigbee.console.ZigBeeConsoleCommandProvider;
import org.openhab.core.thing.ThingTypeUID;
import org.osgi.service.component.annotations.Component;

import com.zsmartsystems.zigbee.console.ZigBeeConsoleAttributeReadCommand;
Expand All @@ -36,6 +36,7 @@
import com.zsmartsystems.zigbee.console.ZigBeeConsoleDescribeNodeCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleDeviceFingerprintCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleDeviceInformationCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleGroupCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleInstallKeyCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleLinkKeyCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleNetworkBackupCommand;
Expand All @@ -47,6 +48,7 @@
import com.zsmartsystems.zigbee.console.ZigBeeConsoleReportingSubscribeCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleReportingUnsubscribeCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleRoutingTableCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleSceneCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleUnbindCommand;
import com.zsmartsystems.zigbee.console.ZigBeeConsoleWindowCoveringCommand;

Expand All @@ -59,19 +61,20 @@
@Component
public class GeneralZigBeeConsoleCommandProvider implements ZigBeeConsoleCommandProvider {

public static final List<ZigBeeConsoleCommand> GENERAL_COMMANDS = unmodifiableList(
asList(new ZigBeeConsoleAttributeReadCommand(), new ZigBeeConsoleAttributeSupportedCommand(),
new ZigBeeConsoleAttributeWriteCommand(), new ZigBeeConsoleBindCommand(),
new ZigBeeConsoleBindingTableCommand(), new ZigBeeConsoleCommandsSupportedCommand(),
new ZigBeeConsoleDescribeEndpointCommand(), new ZigBeeConsoleDescribeNodeCommand(),
new ZigBeeConsoleDeviceFingerprintCommand(), new ZigBeeConsoleDeviceInformationCommand(),
new ZigBeeConsoleInstallKeyCommand(), new ZigBeeConsoleLinkKeyCommand(),
new ZigBeeConsoleNetworkBackupCommand(), new ZigBeeConsoleNetworkJoinCommand(),
new ZigBeeConsoleNetworkLeaveCommand(), new ZigBeeConsoleNodeListCommand(),
new ZigBeeConsoleOtaUpgradeCommand(), new ZigBeeConsoleReportingConfigCommand(),
new ZigBeeConsoleReportingSubscribeCommand(), new ZigBeeConsoleReportingUnsubscribeCommand(),
new ZigBeeConsoleRoutingTableCommand(), new ZigBeeConsoleUnbindCommand(),
new ZigBeeConsoleWindowCoveringCommand()));
@SuppressWarnings("null")
public static final List<ZigBeeConsoleCommand> GENERAL_COMMANDS = unmodifiableList(asList(
new ZigBeeConsoleAttributeReadCommand(), new ZigBeeConsoleAttributeSupportedCommand(),
new ZigBeeConsoleAttributeWriteCommand(), new ZigBeeConsoleBindCommand(),
new ZigBeeConsoleBindingTableCommand(), new ZigBeeConsoleCommandsSupportedCommand(),
new ZigBeeConsoleDescribeEndpointCommand(), new ZigBeeConsoleDescribeNodeCommand(),
new ZigBeeConsoleDeviceFingerprintCommand(), new ZigBeeConsoleDeviceInformationCommand(),
new ZigBeeConsoleGroupCommand(), new ZigBeeConsoleInstallKeyCommand(), new ZigBeeConsoleLinkKeyCommand(),
new ZigBeeConsoleNetworkBackupCommand(), new ZigBeeConsoleNetworkJoinCommand(),
new ZigBeeConsoleNetworkLeaveCommand(), new ZigBeeConsoleNodeListCommand(),
new ZigBeeConsoleOtaUpgradeCommand(), new ZigBeeConsoleSceneCommand(),
new ZigBeeConsoleReportingConfigCommand(), new ZigBeeConsoleReportingSubscribeCommand(),
new ZigBeeConsoleReportingUnsubscribeCommand(), new ZigBeeConsoleRoutingTableCommand(),
new ZigBeeConsoleUnbindCommand(), new ZigBeeConsoleWindowCoveringCommand()));

private Map<String, ZigBeeConsoleCommand> generalCommands = GENERAL_COMMANDS.stream()
.collect(toMap(ZigBeeConsoleCommand::getCommand, identity()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,22 @@ public void write(int value) {
}
}

@Override
public void write(int[] outArray) {
if (outputStream == null) {
return;
}
byte[] bytes = new byte[outArray.length];
int cnt = 0;
for (int value : outArray) {
bytes[cnt++] = (byte) value;
}
try {
outputStream.write(bytes);
} catch (IOException e) {
}
}

@Override
public int read() {
return read(9999999);
Expand Down
14 changes: 1 addition & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<properties>
<report.fail.on.error>false</report.fail.on.error>
<zsmartsystems.version>1.3.10</zsmartsystems.version>
<zsmartsystems.version>1.4.0</zsmartsystems.version>
<spotless.version>2.0.3</spotless.version>
<spotless.check.skip>true</spotless.check.skip> <!-- Spotless disabled for now -->
<sat.version>0.10.0</sat.version>
Expand Down Expand Up @@ -311,18 +311,6 @@
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots-zsmartsystems-com.zsmartsystems</id>
<name>zsmartsystems-com.zsmartsystems</name>
<url>https://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
<releases>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<pluginRepositories>
Expand Down

0 comments on commit 219a5c3

Please sign in to comment.