Setting up I2C on Xavier

Hello.
I have an I2C issues with Xavier. I’m having a hard time figuring out how to setup I2C(bus 8) using C++. Currently I am using rosserial to publish/subscribe with an Arduino (master) and it then communicates bidirectionally with slave controllers over I2C. I’d like to get rid of the master now that I have moved to the Xavier but I can’t find anything only that is easy to understand and implement with regards to I2C using C++ and the Xavier.

At a minimum I’m hoping I could get help setting up the bare bones for I2C communication sending a 7 digit number (1100000-1991023) to a single slave controller 0x12. The 7digit value is coming from a ros subscription.
Thanks.

Below may you need although it’s c code but should be no problem to integrate to for c++ project.

@ ShaneCCC
Thanks for the suggestion. Today I got something working that came from here [url]https://github.com/amaork/libi2c[/url].

In case there is another one of me with I2C issues I will add my changes soon.