diff --git a/docs/classdiagram.svg b/docs/classdiagram.svg index 986651f..4e9b1c0 100644 --- a/docs/classdiagram.svg +++ b/docs/classdiagram.svg @@ -1,3 +1,4 @@ + -
<interface_type→SoftwareSerial>
<interface_type→SoftwareSerial>
CommInterface_modbusRTU
CommInterface_modbusRTU
- deviceId: char
- charTimeout: uint
- frameTimeout: uint
- recTimeout: uint
- deviceId: char...
+ send() 
+ receive()
+ getDeviceId()
+ send()...
- calulateTimeouts()
- clearRxBuffer()
- calulateTimeouts()...
Message
Message
 
 
+ to_string()
+ to_string()
<<struct>>
Message_content_t
<<struct>>Message_content_t
- msg_text: string 
- receiver_id: char
- sender_id: char
- msg_text: string...
MessageService
MessageService
 
 
+ sendNewMessage()
+ stackProcessing()
+ getdestinationId
+ sendNewMessage()...
- sendAck()
- printMessage()
- sendAck()...
Abstract-Service-layer
Abstract-Service-layer
Service-implementation-layer
Service-implementation-layer
Service-layer
Service-layer
ServiceInterface_modbusRTU
ServiceInterface_modbusRTU
 
 
# getPDU_from_services()
# addPDU_to_service() 
+ communicate() 
# getPDU_from_services()...
CommInterface
CommInterface
- interface: interface_type
- interface: interface_type
- receiveBuffer: string*
- sendBuffer: string*
- receiveBuffer: string*...
# send() <<virtual>>
# receive() <<virtual>>
# send() <<virtual>>...
+ sendNewFrame()
+ finishedSending()
+ getReceivedFrame()
+ receivedNewFrame()
+ receiveCycle()
+ sendCycle()
+ sendNewFrame()...
Frame
Frame
- content: string
- representation: const char*
- content: string...
+ getFrame() 
+ getPDU() 
+ getFrame()...
ModbusRTU_Frame
ModbusRTU_Frame
- CRC16mask: short
- CRC16startval: short
- slaveId: char 
- functionCode: char
- buffer: char[0..*]
- CRC16mask: short...
- rep_to_content() 
- content_to_rep() 
- rep_to_content()...
- copy_to_heap()
- calcCRC16()
- copy_to_heap()...
+ check_crc()
+ getFunctionCode()
+ check_crc()...
r/w dedicated memory →
r/w dedicated memory →
←dedicates memory
←dedicates memory
<c→Message, s→2>
<c→Message, s→2>
<<bind>>
<<bind>>
<c→Message_content_t>
<r→String>
<c→Message_content_t>...
<<bind>>
<<bind>>
ServiceCluster<n→1>
ServiceCluster<n→1>
 
 
 
 
<<bind>>
<<bind>>
<n→1>
<n→1>
ServiceClusterBase
ServiceClusterBase
 
 
+ getService_byID()
+ getService_byPos()
+ getNumberOfServices()
+ getService_byID()...
ServiceBase
ServiceBase
 
 
+ get_response() 
+ responseAvailable()
+ clearResponse()
+ stackProcessing()
+ impart_pdu()  
+ get_ServiceId()
+ get_InstanceId()
+ get_response()...
<c→string, r→const char*>
<c→string, r→const char*>
<<bind>>
<<bind>>
CommInterfaceBase
CommInterfaceBase
 
 
+ setup_interface() 
+ sendNewFrame()
+ finishedSending()
+ getReceivedFrame()
+ receivedNewFrame()
+ setup_interface()...
interface_type: typeName
interface_type: typeName
<<bind>>
<<bind>>
<CommInterfaceBase→CommInterface_modbusRTU>
<frameType→Frame_modbusRTU>
<CommInterfaceBase→CommInterface_modbusRTU>...
<<bind>>
<<bind>>
Abstract-Communication-layer
Abstract-Communication-layer
Communication-implementation-layer
Communication-implementation-layer
Communication-layer
Communication-layer
ErrorService
ErrorService
 
 
+ raiseError()
+ stackProcessing()
+ raiseError()...
- printError()
- printError()
<c→Error, s→2>
<c→Error, s→2>
<<bind>>
<<bind>>
Error
Error
 
 
+ to_string()
+ to_string()
<<struct>>
ErrorContent_t
<<struct>>ErrorContent_t
- code: errorCodes
- instanceId: char
- message: String
- code: errorCodes...
- getErrorMessage()
- getErrorMessage()
<<bind>>
<<bind>>
<c→ErrorContent_t>
<r→String>
<c→ErrorContent_t>...
Content_stack
Content_stack
- elements: c[0..s]
- size: int
- elements: c[0..s]...
+ addElement()
+ deleteElement()
+ getElement()
+ addElement()...
+ empty()
+ full()
+ empty()...
c: typeName
s: intExpression
c: typeName...
Content
Content
# content: c
# content: c
# representation: r
# representation: r
+ get_content() 
+ get_content() 
+ get_representation() 
+ get_representation() 
# rep_to_content() <<virtual>>
# rep_to_content() <<virtual>>
# content_to_rep() <<virtual>>
# content_to_rep() <<virtual>>
c, r: typeName
c, r: typeName
Service
Service
# service_id: short 
# instance_id: short 
# response_pdu: String
# rec_stack: Content_stack<c→c, s→s>
# send_stack: Content_stack<c→c, s→s>
# service_id: short...
+ get_response() 
+ responseAvailable()
+ clearResponse()
+ stackProcessing()
+ impart_pdu()  
+ get_ServiceId()
+ get_InstanceId()
+ get_response()...
# write_response_pdu()
# write_response_pdu()
c: typeName
s: intExpression
c: typeName...
ServiceCluster
ServiceCluster
- services: Service[1..n]
- services: Service[1..n]
+ getService_byID()
+ getService_byPos()
+ getNumberOfServices()
+ getService_byID()...
n: intExpression
n: intExpression
ServiceInterface
ServiceInterface
- comm_interface: CommInterfaceBase
- services: ServiceClusterBase
- sendItem: String
- recItem: String
- recStack: Content_stack <c→frameType, s→Stacksize>
- sendStack: Content_stack <c→frameType, s→Stacksize>
- comm_interface: CommInterfaceBase...
# getPDU_from_services() <<virtual>>
# addPDU_to_service() <<virtual>>
# proecessServices()
# processRecStack()
# processSendStack()
+ communicate() <<virtual>>
# getPDU_from_services() <<virtual>>...
CommInterfaceBase: typeName
frameType: typeName
CommInterfaceBase: typeName...
ErrorState
ErrorState
- code: errorCodes 
- code: errorCodes 
+ raiseError()
+ getErrorState()
+ clearErrorState()
+ raiseError()...
<<enumeration>>
errorCodes
<<enumeration>>errorCodes
norError
framingError
crcError
arbitrationError
serviceNotFound
unknownError
norError...
Text is not SVG - cannot display
\ No newline at end of file +
<interface_type→SoftwareSerial>
<interface_type→SoftwareSerial>
CommInterface_modbusRTU
CommInterface_modbusRTU
- deviceId: char
- charTimeout: uint
- frameTimeout: uint
- recTimeout: uint
- deviceId: char...
+ send() 
+ receive()
+ getDeviceId()
+ send()...
- calulateTimeouts()
- clearRxBuffer()
- calulateTimeouts()...
Message
Message
 
 
+ to_string()
+ to_string()
<<struct>>
Message_content_t
<<struct>>Message_content_t
- msg_text: string 
- receiver_id: char
- sender_id: char
- msg_text: string...
MessageService
MessageService
 
 
+ sendNewMessage()
+ stackProcessing()
+ getdestinationId
+ sendNewMessage()...
- sendAck()
- printMessage()
- sendAck()...
Abstract-Service-layer
Abstract-Service-layer
Service-implementation-layer
Service-implementation-layer
Service-layer
Service-layer
ServiceInterface_modbusRTU
ServiceInterface_modbusRTU
 
 
# getPDU_from_services()
# addPDU_to_service() 
+ communicate() 
# getPDU_from_services()...
CommInterface
CommInterface
- interface: interface_type
- interface: interface_type
- receiveBuffer: CharArray*
- sendBuffer: CharArray*
- receiveBuffer: CharArray*...
# send() <<virtual>>
# receive() <<virtual>>
# send() <<virtual>>...
+ sendNewFrame()
+ finishedSending()
+ getReceivedFrame()
+ receivedNewFrame()
+ receiveCycle()
+ sendCycle()
+ sendNewFrame()...
Frame
Frame
- content: String
- representation: CharAray
- content: String...
 
 
ModbusRTU_Frame
ModbusRTU_Frame
- CRC16mask: short
- CRC16startval: short
- slaveId: char 
- functionCode: char
- CRC16mask: short...
- rep_to_content() 
- content_to_rep() 
- rep_to_content()...
- calcCRC16()
+ check_crc()

+ getFunctionCode()
- calcCRC16()...
r/w dedicated memory →
r/w dedicated memory →
←dedicates memory
←dedicates memory
<c→Message, s→2>
<c→Message, s→2>
<<bind>>
<<bind>>
<c→Message_content_t>
<r→String>
<c→Message_content_t>...
<<bind>>
<<bind>>
ServiceCluster<n→1>
ServiceCluster<n→1>
 
 
 
 
<<bind>>
<<bind>>
<n→1>
<n→1>
ServiceClusterBase
ServiceClusterBase
 
 
+ getService_byID()
+ getService_byPos()
+ getNumberOfServices()
+ getService_byID()...
ServiceBase
ServiceBase
 
 
+ get_response() 
+ responseAvailable()
+ clearResponse()
+ stackProcessing()
+ impart_pdu()  
+ get_ServiceId()
+ get_InstanceId()
+ get_response()...
<c→string, r→const char*>
<c→string, r→const char*>
<<bind>>
<<bind>>
CommInterfaceBase
CommInterfaceBase
 
 
+ setup_interface() 
+ sendNewFrame()
+ finishedSending()
+ getReceivedFrame()
+ receivedNewFrame()
+ setup_interface()...
interface_type: typeName
interface_type: typeName
<<bind>>
<<bind>>
<CommInterfaceBase→CommInterface_modbusRTU>
<frameType→Frame_modbusRTU>
<CommInterfaceBase→CommInterface_modbusRTU>...
<<bind>>
<<bind>>
Abstract-Communication-layer
Abstract-Communication-layer
Communication-implementation-layer
Communication-implementation-layer
Communication-layer
Communication-layer
ErrorService
ErrorService
 
 
+ raiseError()
+ stackProcessing()
+ raiseError()...
- printError()
- printError()
<c→Error, s→2>
<c→Error, s→2>
<<bind>>
<<bind>>
Error
Error
 
 
+ to_string()
+ to_string()
<<struct>>
ErrorContent_t
<<struct>>ErrorContent_t
- code: errorCodes
- instanceId: char
- message: String
- code: errorCodes...
- getErrorMessage()
- getErrorMessage()
<<bind>>
<<bind>>
<c→ErrorContent_t>
<r→String>
<c→ErrorContent_t>...
Content_stack
Content_stack
- elements: c[0..s]
- size: int
- elements: c[0..s]...
+ addElement()
+ deleteElement()
+ getElement()
+ addElement()...
+ empty()
+ full()
+ empty()...
c: typeName
s: intExpression
c: typeName...
Content
Content
# content: c
# content: c
# representation: r
# representation: r
+ get_content() 
+ get_content() 
+ get_representation() 
+ get_representation() 
# rep_to_content() <<virtual>>
# rep_to_content() <<virtual>>
# content_to_rep() <<virtual>>
# content_to_rep() <<virtual>>
c, r: typeName
c, r: typeName
Service
Service
# service_id: short 
# instance_id: short 
# response_pdu: String
# rec_stack: Content_stack<c→c, s→s>
# send_stack: Content_stack<c→c, s→s>
# service_id: short...
+ get_response() 
+ responseAvailable()
+ clearResponse()
+ stackProcessing()
+ impart_pdu()  
+ get_ServiceId()
+ get_InstanceId()
+ get_response()...
# write_response_pdu()
# write_response_pdu()
c: typeName
s: intExpression
c: typeName...
ServiceCluster
ServiceCluster
- services: Service[1..n]
- services: Service[1..n]
+ getService_byID()
+ getService_byPos()
+ getNumberOfServices()
+ getService_byID()...
n: intExpression
n: intExpression
ServiceInterface
ServiceInterface
- comm_interface: CommInterfaceBase
- services: ServiceClusterBase
- sendItem: CharArray
- recItem: CharArray
- recStack: Content_stack <c→frameType, s→Stacksize>
- sendStack: Content_stack <c→frameType, s→Stacksize>
- comm_interface: CommInterfaceBase...
# getPDU_from_services() <<virtual>>
# addPDU_to_service() <<virtual>>
# proecessServices()
# processRecStack()
# processSendStack()
+ communicate() <<virtual>>
# getPDU_from_services() <<virtual>>...
CommInterfaceBase: typeName
frameType: typeName
CommInterfaceBase: typeName...
ErrorState
ErrorState
- code: errorCodes 
- code: errorCodes 
+ raiseError()
+ getErrorState()
+ clearErrorState()
+ raiseError()...
<<enumeration>>
errorCodes
<<enumeration>>errorCodes
norError
framingError
crcError
arbitrationError
serviceNotFound
unknownError
norError...
2
2
CharArray
CharArray
- data: char*
- size: int
- data: char*...
- extendArray()
+ getSize()
+ getData()
+ getHexString()
- extendArray()...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/docs/modbus_classdiagram.drawio b/docs/modbus_classdiagram.drawio index 9fd3e2c..e7723c7 100644 --- a/docs/modbus_classdiagram.drawio +++ b/docs/modbus_classdiagram.drawio @@ -1,6 +1,6 @@ - + - + @@ -40,7 +40,7 @@ - + @@ -128,13 +128,21 @@ + + + + + + + + - + @@ -159,16 +167,16 @@ - + - + - - + + @@ -179,22 +187,19 @@ - + - - + + - + - - - - + - - + + @@ -318,7 +323,8 @@ - + + @@ -336,11 +342,17 @@ - - + + + + + + + + - + @@ -540,7 +552,7 @@ - + @@ -552,39 +564,69 @@ - - + + - + - + - + - + - - - + + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +