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_modbusRTUCommInterface_modbusRTU- deviceId: char- charTimeout: uint- frameTimeout: uint- recTimeout: uint- deviceId: char...+ send() + receive()+ getDeviceId()+ send()...- calulateTimeouts()- clearRxBuffer()- calulateTimeouts()...MessageMessage + to_string()+ to_string()<<struct>>Message_content_t<<struct>>Message_content_t- msg_text: string - receiver_id: char- sender_id: char- msg_text: string...MessageServiceMessageService + sendNewMessage()+ stackProcessing()+ getdestinationId+ sendNewMessage()...- sendAck()- printMessage()- sendAck()...Abstract-Service-layerAbstract-Service-layerService-implementation-layerService-implementation-layerService-layerService-layerServiceInterface_modbusRTUServiceInterface_modbusRTU # getPDU_from_services()# addPDU_to_service() + communicate() # getPDU_from_services()...CommInterfaceCommInterface- 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()...FrameFrame- content: string- representation: const char*- content: string...+ getFrame() + getPDU() + getFrame()...ModbusRTU_FrameModbusRTU_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>ServiceClusterBaseServiceClusterBase + getService_byID()+ getService_byPos()+ getNumberOfServices()+ getService_byID()...ServiceBaseServiceBase + 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>>CommInterfaceBaseCommInterfaceBase + setup_interface() + sendNewFrame()+ finishedSending()+ getReceivedFrame()+ receivedNewFrame()+ setup_interface()...interface_type: typeNameinterface_type: typeName<<bind>><<bind>><CommInterfaceBase→CommInterface_modbusRTU><frameType→Frame_modbusRTU><CommInterfaceBase→CommInterface_modbusRTU>...<<bind>><<bind>>Abstract-Communication-layerAbstract-Communication-layerCommunication-implementation-layerCommunication-implementation-layerCommunication-layerCommunication-layerErrorServiceErrorService + raiseError()+ stackProcessing()+ raiseError()...- printError()- printError()<c→Error, s→2><c→Error, s→2><<bind>><<bind>>ErrorError + 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_stackContent_stack- elements: c[0..s]- size: int- elements: c[0..s]...+ addElement()+ deleteElement()+ getElement()+ addElement()...+ empty()+ full()+ empty()...c: typeNames: intExpressionc: typeName...ContentContent# 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: typeNamec, r: typeNameServiceService# 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: typeNames: intExpressionc: typeName...ServiceClusterServiceCluster- services: Service[1..n]- services: Service[1..n]+ getService_byID()+ getService_byPos()+ getNumberOfServices()+ getService_byID()...n: intExpressionn: intExpressionServiceInterfaceServiceInterface- 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: typeNameframeType: typeNameCommInterfaceBase: typeName...ErrorStateErrorState- code: errorCodes - code: errorCodes + raiseError()+ getErrorState()+ clearErrorState()+ raiseError()...<<enumeration>>errorCodes<<enumeration>>errorCodesnorErrorframingErrorcrcErrorarbitrationErrorserviceNotFoundunknownErrornorError...Text is not SVG - cannot display \ No newline at end of file +<interface_type→SoftwareSerial><interface_type→SoftwareSerial>CommInterface_modbusRTUCommInterface_modbusRTU- deviceId: char- charTimeout: uint- frameTimeout: uint- recTimeout: uint- deviceId: char...+ send() + receive()+ getDeviceId()+ send()...- calulateTimeouts()- clearRxBuffer()- calulateTimeouts()...MessageMessage + to_string()+ to_string()<<struct>>Message_content_t<<struct>>Message_content_t- msg_text: string - receiver_id: char- sender_id: char- msg_text: string...MessageServiceMessageService + sendNewMessage()+ stackProcessing()+ getdestinationId+ sendNewMessage()...- sendAck()- printMessage()- sendAck()...Abstract-Service-layerAbstract-Service-layerService-implementation-layerService-implementation-layerService-layerService-layerServiceInterface_modbusRTUServiceInterface_modbusRTU # getPDU_from_services()# addPDU_to_service() + communicate() # getPDU_from_services()...CommInterfaceCommInterface- 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()...FrameFrame- content: String- representation: CharAray- content: String... ModbusRTU_FrameModbusRTU_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>ServiceClusterBaseServiceClusterBase + getService_byID()+ getService_byPos()+ getNumberOfServices()+ getService_byID()...ServiceBaseServiceBase + 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>>CommInterfaceBaseCommInterfaceBase + setup_interface() + sendNewFrame()+ finishedSending()+ getReceivedFrame()+ receivedNewFrame()+ setup_interface()...interface_type: typeNameinterface_type: typeName<<bind>><<bind>><CommInterfaceBase→CommInterface_modbusRTU><frameType→Frame_modbusRTU><CommInterfaceBase→CommInterface_modbusRTU>...<<bind>><<bind>>Abstract-Communication-layerAbstract-Communication-layerCommunication-implementation-layerCommunication-implementation-layerCommunication-layerCommunication-layerErrorServiceErrorService + raiseError()+ stackProcessing()+ raiseError()...- printError()- printError()<c→Error, s→2><c→Error, s→2><<bind>><<bind>>ErrorError + 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_stackContent_stack- elements: c[0..s]- size: int- elements: c[0..s]...+ addElement()+ deleteElement()+ getElement()+ addElement()...+ empty()+ full()+ empty()...c: typeNames: intExpressionc: typeName...ContentContent# 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: typeNamec, r: typeNameServiceService# 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: typeNames: intExpressionc: typeName...ServiceClusterServiceCluster- services: Service[1..n]- services: Service[1..n]+ getService_byID()+ getService_byPos()+ getNumberOfServices()+ getService_byID()...n: intExpressionn: intExpressionServiceInterfaceServiceInterface- 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: typeNameframeType: typeNameCommInterfaceBase: typeName...ErrorStateErrorState- code: errorCodes - code: errorCodes + raiseError()+ getErrorState()+ clearErrorState()+ raiseError()...<<enumeration>>errorCodes<<enumeration>>errorCodesnorErrorframingErrorcrcErrorarbitrationErrorserviceNotFoundunknownErrornorError...22CharArrayCharArray- 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 @@ - - + + - + - + - + - + - - - + + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +