Giter VIP home page Giter VIP logo

canopen_sdosvr_st's Introduction

** Work In Progress **

  • ๐Ÿ‘‹ Hi, Iโ€™m @msftrncs (or Carl Morris)
  • ๐Ÿ‘€ Iโ€™m interested in ...
    • PowerShell
    • Regular Expressions
    • IEC 61131-3
    • TextMate Grammars
    • Databases
  • ๐ŸŒฑ Iโ€™m currently learning ...
    • Old tricks
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on ...
  • ๐Ÿ“ซ How to reach me ...

canopen_sdosvr_st's People

Contributors

msftrncs avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

canopen_sdosvr_st's Issues

CANSDO_IsEnum not cleared if application directly utilizes TX_ACK_EXP_DN, or TX_ERR_BAD_SIZE, TX_ERR_INV_VAL, TX_ERR_NO_DATA, TX_ERR_R_ONLY, TX_ERR_W_ONLY

While I have not experienced an issue with this in my applications, it was noticed that, CANSDO_IsEnum is not cleared if the application directly utilizes the action TX_ACK_EXP_DN to acknowledge the expedited download, instead of using action DispatchResponse. CANSDO_IsEnum may then remain set when the next request is processed, and in most cases this only results in muting of errors if the next request results in such an error.

The code is being reviewed further to see if there are further situations where this may occur.

Buffer Overrun response may not be sent on expedited download requests

i := 0;
WHILE i < Request_LEN DO
IF i >= Response_BUFFER_LEN THEN
EXIT;
END_IF
Response_BUFFER_PTR^[i] := CANSDO_DATA[i + 4]; (* copy data *)
i := i + 1;
END_WHILE
Request_LEN := i; (* length of data downloaded *)
(* if request length was known, then its a problem if there was more data than buffer, but not if length was not known *)
Request_BUFFEROVERRUN := SEL( Request_LEN_KNOWN, FALSE, i > Response_BUFFER_LEN );

The expression for Request_BUFFEROVERRUN may never be set because i will not exceed Response_BUFFER_LEN when the WHILE loop exits upon detecting that the supplied buffer has been filled to capacity.

The correction requires rearranging lines (382-384):

		(* if request length was known, then its a problem if there was more data than buffer, but not if length was not known *)
		Request_BUFFEROVERRUN := SEL( Request_LEN_KNOWN, FALSE, Request_LEN > Response_BUFFER_LEN );
		IF Request_BUFFEROVERRUN THEN
			Request_LEN := i; (* length of data downloaded *)
		END_IF

Default non-action is INV_OBJ, with no way to provide no response.

If an object post processor does not otherwise provide a response to a request, the the SDO SVR Protocol Processor will automatically generate an ERR_INV_OBJ (invalid object ID) response, and this response cannot be prevented.

This is a problem when operating in a mixed environment where another SDO server may be responsible for providing some objects. While this is NOT an ideal situation, because the two SDO servers will not be aware of each other, it should still be possible for them to coexist mostly peacefully.

I am considering to add an action that will cause a non-response to a request.

I am also considering changing the default behavior so that the application must explicitly request the ERR_INV_OBJ response, instead of it being automatic, and then a non-response action will not be necessary. (The {PRIVATE} attribute will need to be removed from TX_ERR_INV_OBJ action then.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.