Endianess (Big Endian/Little Endian) support in plc4x library - apache-plc4x

I want to check if there is support for endianness(little endian/big endian) in plc4x modbus library to process the response based on that . I could not find any documentation or example on how to use if it exists.
So, request to same some links here if available.

Right now we currently don't support this, but we are aware of an option to fix this. Till now we haven't implemented any support for this mainly because none of our core contributors has access to such a Modbus device. If you have one particular device in mind, could you please name the Type an model or if you could provide us with such a device ... perhaps we can come up with an implementation.

Related

Applying Non-Standard Power Assertions & Creating Virtual HIDs

I've got a big ask here, but I am hoping someone might be able to help me. If there's another site you think this should be posted on, please let me know.
I'm the developer of the free app Amphetamine for macOS and I'm hoping to add a new feature to the app - keeping a Mac awake while in closed-display (clamshell) mode while not having a keyboard/mouse/power adapter/display connected to the Mac. I get requests to add this feature on an almost daily basis.
I've been working on a solution (and it's mostly ready) which uses a non-App Store helper app that must be download and installed separately. I could still go with that solution, but I want to explore one more option before pushing the separate app solution out to the world.
An Amphetamine user tipped me off that another app, AntiSleep can keep a Mac awake while in closed-display mode, while not meeting Apple's requirements. I've tested this claim, and it's true. After doing a bit of digging into how AntiSleep might be accomplishing this, I've come up with 2 possible theories so far (though there may be more to it):
In addition to the standard power assertion types, it looks like AntiSleep is using (a) private framework(s) to apply non-standard power assertions. The following non-standard power assertion types are active when AntiSleep is keeping a Mac awake: DenySystemSleep, UserIsActive, RequiresDisplayAudio, & InternalPreventDisplaySleep. I haven't been able to find much information on these power assertion types beyond what appears in IOPMLibPrivate.h. I'm not familiar at all with using private frameworks, but I assume I could theoretically add the IOPMLibPrivate header file to a project and then create these power assertion types. I understand that would likely result in an App Store review rejection for Amphetamine, of course. What about non-App Store apps? Would Apple notarize an app using this? Beyond that, could someone help me confirm that the only way to apply these non-standard power assertions is to use a private framework?
I suspect that AntiSleep may also be creating a virtual keyboard and mouse. Certainly, the idea of creating a virtual keyboard and mouse to get around Apple's requirement of having a keyboard and mouse connected to the Mac when using closed-display mode is an intriguing idea. After doing some searching, I found foohid. However, I ran into all kinds of errors trying to add and use the foohid files in a test project. Would someone be willing to take a look at the foohid project and help me understand whether it is theoretically possible to include this functionality in an App Store compatible app? I'm not asking for code help with that (yet). I'd just like some help determining whether it might be possible to do.
Thank you in advance for taking a look.
Would Apple notarize an app using this?
I haven't seen any issues with notarising code that uses private APIs. Currently, Apple only seems to use notarisation for scanning for inclusion of known malware.
Would someone be willing to take a look at the foohid project and help me understand whether it is theoretically possible to include this functionality in an App Store compatible app?
Taking a quick glance at the code of that project, it's clear it implements a kernel extension (kext). Those are not allowed on the App Store.
However, since macOS 10.15 Catalina, there's a new way to write HID drivers, using DriverKit. The idea is that the APIs are very similar to the kernel APIs, although I suspect it'll be a rewrite of the kext as a DriverKit driver, rather than a simple port.
DriverKit drivers are permitted to be included in App Store apps.
I don't know if a DriverKit based HID driver will solve your specific power management issue.
If you go with a DriverKit solution, this will only work on 10.15+.
I suspect that AntiSleep may also be creating a virtual keyboard and mouse.
I haven't looked at AntiSleep, but I do know that in addition to writing an outright HID driver, it's possible to generate HID events using user space APIs such as IOHIDPostEvent(). I don't know if those are allowed on the App Store, but as far as I'm aware, IOKitLib is generally fine.
It's possible you might be able to implement your virtual input device using those.

Nnanomsg bus routing support?

I have been using NNG (C++) - now I need to write a C# plugin to read the NNG NanoMSG messages. But I am moving from pub/sub to a bus/mesh protocol. e.g.
https://nanomsg.org/gettingstarted/bus.html
Does nnanomsg support that?
What switches on the socket (options do I need) e.g. NN_BUS? NN_SOL_SOCKET?
The last PR merged included a Bus example. That said, I haven't used the Bus protocol.
If you're using nng, there's also a C# wrapper for that called csnng. I believe it doesn't include the nanomsg "compat" API, but it includes the nng bus protocol.
Not that it's a substantial amount of work, but I forked both NNanomsg and csnng to make .Net Standard libraries.
Don't know why the question should be marked negative. Although no one answered, I went implemented it with: https://github.com/mhowlett/NNanomsg
and the answers to the questions are:
Yes NNanomsg works fine with C++ NNG
Yes it has no problem with BUS protocols, and there are examples in the github.

Is there an implementation specification for the Kermit file transfer protocol (serial)?

I need a serial protocol for an embedded system that has some quirks. Right now it does YModem, but there are hiccups, so I thought I would try Zmodem or Kermit. Zmodem has both code and a clear enough implementation spec.
I can find nothing from which I can implement the file transfer protocol of Kermit from "scratch" (nor usable code).
There's source that isn't well organized and includes full terminal emulators and TCP clients, with all kinds of sections and options for every computer including antiques. E.g. C-Kermit 9.0. I'd spend more time refactoring it to extract just what I need than implementing it outright.
There is an abstruse mathematical paper that I find confusing since it doesn't talk about bits and bytes only something between a formal proof and pseudocode. (Proof.pdf - and it has theorems, proofs, and lemmas!). It claims to be some kind of specification. Maybe buried in there somewhere, but the same problem, I'd have to spend a while extracting the actual coding information.
I need some of the advanced features (full sliding windows), but the Embedded Kermit says it doesn't have those (though has some partial bits or hooks) but does have some other stuff I neither want nor need.
I don't think I would have any trouble writing Kermit from a real specification targeted to programmers as to what goes over the wire (content and timing), or better yet, a clean but full implementation.
I can't find either. Does anyone here know of one?
The kermit protocol was documented in the book Kermit, a File Transfer Protocol by Frank Da Cruz (Digital Press, 1987). There's an online document called Kermit Protocol Manual (1986), which I assume is an earlier version of the book.
Some of the optional features in the manual have never been implemented, and there are also some optional features that have been implemented but never found their way into the manual. If you're interested in these exotic extensions, you will need to browse through this archive of Kermit protocol discussions.

SPICE protocol extension

I am doing a project that extends SPICE. I need to send some custom data between server and client. I beleiev this is done by adding a custom channel to the SPICE protocol
I've got the source code, but it's huge and overwhelming. Can anyone give me a few pointers as to how to start, or direct me to a similar project so I can refer?
Thanks in advance
I suggest to start reading the "SPICE for Newbies" document, then moving to other documentation. It will give you some introduction on the architecture of SPICE, the protocol, standard channels, etc.
Available on spice-space.org/documentation.html
Since spice-gtk 0.15, and qemu 1.4.0, you can set up arbitrary channels by name using the "Spice port", see spicy.c code for an example of usage.

cmakeable version of protocol buffers

StackOverflow community!
I want to embed protocol buffers into some project that supports cmake.
As I undrestood, google doesn't provide this
Any suggestions? Who tried to create cmakeable protocol buffers library?
Are there lots of not cross-platform places at the source or there is no at all.
Where can I take it if it exists?
What else cmakeable is there instead of protocol buffers?
Pls, don't ask me why I don't install protocol buffers, and just use compiled libraries,
I need to embed it inside the project.
If it is really bad idea, then, please, explain why.
I created a set of CMakeLists.txt for protobufs for embedding into our build systems, and offered to contribute these to protobufs, but the people at Google weren't interested.
If you'd like, I can provide them "as-is". They work for 2.2.0, but you will probably have to do some hacking on your own to tweak them for your specific build system.