Git Product home page Git Product logo

Comments (5)

pavel-kirienko avatar pavel-kirienko commented on August 20, 2024

Not sure about option 2 because it doesn't provide a way for the user to make an informed decision about which interface to use (e..g, is bool[1] the can1 or slcan0?). Option 1 seems sensible although it may require some non-trivial logic for detection of the available interfaces. Would you be up to drafting up a prototype based on PyUAVCAN?

https://github.com/UAVCAN/pyuavcan/blob/9da3cf579b65cae4067b16c621cc3321156f17d4/pyuavcan/transport/can/media/_media.py#L147-L163

from public_regulated_data_types.

PetervdPerk-NXP avatar PetervdPerk-NXP commented on August 20, 2024

Not sure what you mean by a prototype using pyuavcan, you can easily make a register response in yakut right?
Regarding that piece of code you can easily generate a list of CAN capable interfaces if that's what you want.

import re
import psutil
ifaces = [ s for s in psutil.net_if_addrs() if re.compile(r"^(v|sl|)can\d+").match(s) ]

For me it's more to understand/standardize the minimal set of registers i.e. uavcan.can.iface a node running on a small MCU has to implement. It's easy to come up with a custom register/service that exposes the available interfaces but I rather want to standardize it in the uavcan.register spec like is done for id,iface,bitrate etc.

from public_regulated_data_types.

pavel-kirienko avatar pavel-kirienko commented on August 20, 2024

Not sure what you mean by a prototype using pyuavcan, you can easily make a register response in yakut right?

Yakut can't serve RPC-services. In PyUAVCAN you would integrate your sample like this:

import re
import psutil  # <-- these batteries are not included
your_node.registry["uavcan.can.ifaces"] = lambda: " ".join(s for s in psutil.net_if_addrs() if re.compile(r"^(v|sl|)can\d+").match(s))

For me it's more to understand/standardize the minimal set of registers i.e. uavcan.can.iface a node running on a small MCU has to implement.

I don't understand this part: why does a typical embedded node need to report the list of available CAN interfaces?

from public_regulated_data_types.

PetervdPerk-NXP avatar PetervdPerk-NXP commented on August 20, 2024

I don't understand this part: why does a typical embedded node need to report the list of available CAN interfaces?

To remotely configure redundancy ie. enabling 2 interfaces, but there are also commercially available MCU's that have up to 8 CAN controllers so it would be great to have to flexibility to change the CAN port remotely.

from public_regulated_data_types.

pavel-kirienko avatar pavel-kirienko commented on August 20, 2024

Okay, that makes sense.

We still should update PyUAVCAN to expose this register before updating the Spec though.

from public_regulated_data_types.

Related Issues (20)

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.