use of org.apache.plc4x.java.canopen.readwrite.CANOpenDataType in project plc4x by apache.
the class CANOpenPDOField method of.
public static CANOpenPDOField of(String addressString) {
Matcher matcher = getMatcher(addressString);
int nodeId = Integer.parseInt(matcher.group("nodeId"));
String pdo = matcher.group("pdo");
CANOpenService service = CANOpenService.valueOf(pdo);
String canDataTypeString = matcher.group("canDataType");
CANOpenDataType canOpenDataType = CANOpenDataType.valueOf(canDataTypeString);
return new CANOpenPDOField(nodeId, service, canOpenDataType);
}
use of org.apache.plc4x.java.canopen.readwrite.CANOpenDataType in project plc4x by apache.
the class CANOpenSDOField method of.
public static CANOpenSDOField of(String addressString) {
Matcher matcher = getMatcher(addressString);
int nodeId = Integer.parseInt(matcher.group("nodeId"));
short index = parseHex(matcher.group("indexHex"), matcher.group("index"));
short subIndex = parseHex(matcher.group("subIndexHex"), matcher.group("subIndex"));
String canDataTypeString = matcher.group("canDataType");
CANOpenDataType canOpenDataType = CANOpenDataType.valueOf(canDataTypeString);
String answerNode = matcher.group("answerNodeId");
if (answerNode != null) {
int answerNodeId = Integer.parseInt(matcher.group("answerNodeId"));
return new CANOpenSDOField(nodeId, answerNodeId, index, subIndex, canOpenDataType);
}
return new CANOpenSDOField(nodeId, index, subIndex, canOpenDataType);
}
Aggregations