Open-Agriculture / AgIsoStack-plus-plus

AgIsoStack++ is the completely free open-source C++ ISOBUS library for everyone
https://agisostack.com/
MIT License
187 stars 41 forks source link

Auxiliary Capabilities Request #454

Open yuiopt opened 6 months ago

yuiopt commented 6 months ago

Hi, I searched the source, found out that the "Auxiliary Capabilities Request" was not implemented , and I am confused about the protocol response describing "Number of Instances: Indicates the number of input/function instances where the described Function attribute and Assigned attribute are the same". I'd like to contribute this part, can anyone explain how to get the number of instances?

ad3154 commented 6 months ago

It's a bit confusing to me as well... I can see if I can find out more. But, if you're wanting to contribute the client side of this, then a complete understanding might not be strictly needed I guess, as if I was going to implement sending of the request and receiving of the reply, I'd probably just give that information verbatim to the consumer of the library and let them use it as they see fit?

Like, I'd probably pass them (in a callback or something) the values listed under J.7.14 bytes 3-n repeating in a const class, maybe something like

class AuxiliaryCapabilities
{
public:
    class SetInformation
    {
    public:
        std::uint8_t numberOfInstances;
        std::uint8_t functionAttribute;
        std::uint8_t assignedAttribute; 
    };
    NAME auxiliaryUnitNAME;
    std::vector<SetInformation> sets;
};

Could also use enums or something to clarify further, but I think that'd be the general idea? Then the answer to "how to get the number of instances" is just "it's whatever the VT sends back to you" since the VT provides that based on the content of the other working sets' object pools.