Convert from mbus protocol to modbusIP - raspberry-pi

Im trying to convert mbus protocol to modbus IP protocol with a raspberry.
Im new on this, just doing bcs my boss asked. I´ve been searching on all google, but I found nothing. Any help would be helpful.
I´ve tried to read mbus bytes to convert, but it´s impossible.

Both protocols seem to be completely different.
So if you want to convert, you will have to create a dedicated library. A huge pile of work. And, on top of that, I am not really sure that you can represent the same data in both protocols, as they have different goals.
But maybe you want to encapsulate MBus in Modbus, in order to travel on Modbus, and at the other end extract it to decode MBus where needed.
I think we need more info on your exact goal here.
Anyway, MBus protocol is described in standard EN13757 that you will need to get if you plan to decode this protocol.
[I have been creating a library decoding MBus protocol, but it is not open-source nor publicly available. If you need furher help with MBus protocol, you can contact me.]

Related

How to use Core Audio in Swift language

I'm starting using Swift for my new audio app and I need to use Apple Core Audio library.
Let's be honest, Swift is a great language and I love it but as soon as we have to use C, pointers and other stuff it becomes really annoying to use it.
In order to make it a clear and clean interface I would to know you thoughts about interfacing Core Audio and Swift.
I thought to use C++ (for the convenients std::vector and more) or C but both require using bridging.
So my questions are:
Do you use pure Swift or C/C++Bridge when you use Core Audio?
Which one will be the faster?
I think I found the answers so I will leave it here if somebody is interested
The bridge approach is preferred. As invalidname (Chris Adamson) said in media framework talk you have to Render unto Caesar the things that are Caesar's, and unto God the things that are God's i.e use C for C API and Swift for swifty things.
Talking about performance I found an article which discusses about it. The conclusion is that for primitive type there is no problem by making all the type conversion, calling C function and making the backward type conversion. But for some type like String/char*, struct and more complicated type you could encoure performance decrease.
Btw don't hesitate to add more things if you think it could help other people.

Writing a protocol that has client and server side software

I will be developing a protocol that will encompass a client and a server module.
Several protocols that are close to the one I have in mind exist, but I want to make something simpler with less overhead and with something I have more control on.
The protocol I will be doing can and will be run almost in any scenario, local, web, lan, internet, etc. It can also run on a single box.
My question is, how can I start developing for the server side of the protocol?
Any ideas, insights, key words, starting points would be appreciated.
Regards
Do you want to develop the protocol yourself and then use it? or you are looking for a good protocol to use?
If second, I have recently worked with "Websocket" protocol which enables clients to communicate with each other via a server. It is a really good protocol and there are libraries in .NET ( >= 4.5), JAVA, Javascript, ... It is also supported in many browsers.

Need to implement client-server applications in different language that can communicate with each other

I want to build a client and server application using Socket programming that can chat but the client and server has to be implemented in different languages.
I want to use C# and Java for that purpose. I want to know if its possible and if it is How?Thanks
It is possible and pretty easy, especially with C# and Java. Their implementation of sockets is pretty similar.
Few things to watch for:
Make sure you are serializing integers in network order. If I remember correctly Java and .NET put bytes on the wire in a different order. See this post for some guidance.
Make sure you are encoding/decoding your strings consistently, like using Unicode on both sides.
Don't try using unsigned integer types, Java only supports signed types (I'm sure there are libraries to deal with it if necessary).
I don't know how compatible float and double serializations are on both sides, so if you need it do some more investigation.
Good luck and have fun!

MSN API for Objective-C

I would like to know whether if there is any Objective-C MSN API. I have searched for a while and could not really find one.
And if not could somebody tell some good place to look to start the protocol from scratch. Some points on how to start with.
I found this site mentioning details about the protocol. But still not sure how to start with.
http://www.hypothetic.org/docs/msn/index.php
Thank you and Kind Regards,
Tharindu
I think you might be out of luck. MSN is proprietary so APIS are going to be thin on the ground and those that exist will be reverse engineered.
Having said that, Pidgin is an open source IM client that supports MSN. You could use its core library (libpurple) which is written in C and hence compatible with Objective-C.

The Point of Bencoding

Lately i have been messing around with bittorrent protocol. I fail to see the point in bencoding files other than giving me headache in parsing them? What advantages does it have? Why not use xml?
/sarcasm
For one thing, I'm pretty sure bencoding is more space-efficient than equivalent XML.