how to obtain ipmi fru raw data? - c++

Is there API for obtaining ipmi fru raw bytes?
I need to work with custom FRU data. I've tried to use freeipmi library - but it seems it has only API to access custom fields and does not expose API to read whole fru buffer.

I am not sure if any library provides special API function for reading raw FRU data. As you noticed freeipmi and openipmi provides convenient functions that provides 'cooked' data.
But openipmi (I think freeipmi) as well provides API functions for sending raw commands and and IPMI commands to get raw FRU data. Openipmi has functions ipmi_send_command_addr() and ipmi_mc_send_command() and they send an IPMI command to a specified target.
To get raw fru data you need to issue IPMI command "Get FRU Inventory Area Info" to get FRU length and then issue IPMI command "Read FRU data".

In FreeIPMI 1.5.2 there is a new --read-fru and --write-fru option in bmc-device that allows you to read out a FRU into a file and write a FRU raw file back to a specific device ID. If you take a look at the code in bmc-device, perhaps that code would be sufficient for your needs.
It is specific to read/write for a specific device ID. But a loop and some error handling should enable you to obtain the entire FRU buffer.
Full Disclosure: I'm the maintainer of FreeIPMI.

Related

Not able to create Object for audioRawData while trying to access Raw Audio of user using video sdk zoom

Description
I want to access Raw audio stream for a meeting using videoSDK. For this I came across Windows SDK and am trying to use the same to get the raw data.
https://marketplace.zoom.us/docs/sdk/video/windows/advanced/raw-data/
I am trying to use
CExampleRawAudioSenderAndSpeaker::onVirtualSpeakerSharedAudioReceived(AudioRawData* data_)
for getting audio stream, but unfortunately, I am not able to create AudioRawData object which can be passed to the function. I am trying to find the Initialization function for it but there is no supporting docs for it.
Which Windows Video SDK version?
1.6.2
Additional context
I am not an experienced developer for this as I am using VideoSDK for the first time.
https://devforum.zoom.us/t/not-able-to-create-object-for-audiorawdata-while-trying-to-access-raw-audio-of-user-using-video-sdk/81990?u=prakhar.k

send pcl point cloud over tcp in c++

I am new to data serialization in c++, I searched for examples but I was not really successful.
My goal is to be able to send and receive a pcl point cloud over tcp in c++. I am familiar with ROS, but now I cannot use it in the server. I have to send point cloud through ethernet to a client machine, where I am free to use ROS.
I tried Python with ZeroMQ configured to send the point cloud in numpy array. The message contained a json markdown with the array shape and then another message contained the array.
If i am correct, in c++ I should serialize my pcl::PointCloud<pcl::PointXYZ> cloud object to be able to send it somehow. In case of c++ I cannot find it possible to send array shape as markdown.
Is it possible in c++ to send this cloud object similar as in zmq? Or is there a more handy approach to this problem?
update:
In cpp, I read the point cloud from camera, into pcl::PointCloud<pcl::PointXYZ> object. My goal is to send somehow this data through tcp and be able to reconstruct into a similar point cloud object preferably in cpp.
C++ does not provide a standard method to serialize and deserialize data.
You can implement this yourself for simple cases.
For more complex cases you can use a library, such as protocol buffers or Boost serialization.
You can also use a text-based format "on the wire", such as XML or JSON.

How to Create a QRcode for Wifi Connection using libqrencode?

I am able to generate a QRCode for Plain Text using libQrencode with the API QRcode_encodeString() and Reading using Zxing Lib APIS.
Is there anyway I can create QRCode for Wifi Connection or File Transfer Request like http://zxing.appspot.com/generator and On reading the Generated QRCode Wifi gets connected or File Transfer should start.
QRCode is basically transporting data in form of Image.
Well, it will vary clear with the above line, we need to create the Plain Text with the information needed and Write the Parser to get the individual details needed.
For Example:
For a Wifi Network, we need the below Fields of information:
SSID
PASSWORD
NETWORK TYPE
Append all the info in single text like
"SSID:name,PASSWORD:passkey,NETWORKTYPE:type" (We can use Json rather writing a Custom Parser.
I will post the Complete Code soon.

libcurl: Detect chunk boundaries of chunk-encoded responses

I am using libcurl, currently the easy api. I am making a request to a web server that responds with HTTP Chunked Encoding. I would like to know if there is a way to know when a chunk from the server has finished. I was looking for some type of callback. DEBUGDATA didn't seem to include it, and CHUNK_END_FUNCTION seemed to be unrelated.
If you use the CURLOPT_DEBUGFUNCTION option you will get the data "un-chunked" and then you can scan and parse the data yourself as you see fit and thus track the end of chunks or whatever you like. ()
As "n.m." already said, libcurl has no API that exposes chunks as it tries to make the transfer encoding completely transparent to users.
Alternatively, applications can tell libcurl to not decode chunked transfer encoding at all and instead pass it on as-is to the application with CURLOPT_HTTP_TRANSFER_DECODING.
No, libcurl doesn't have any API that would let you know that.

How do I write the audio stream to a memory buffer instead of a file using DirectShow?

I have made a sample application which constructs a filter graph to capture audio from the microphone and stream it to a file. Is there any filter which allows me to stream to a memory buffer instead?
I'm following the approach outlined in an article on msdn and are currently using the CLSID_FileWriter object to write the audio to file. This works nicely, but I cannot figure out how to write to a memory buffer.
Is there such a memory sink filter or do I have to create it myself? (I would prefer one which is bundled with windows XP)
The easiest way to do this (although not the most elegant) is to use a Sample Grabber filter followed by a Null Renderer filter to terminate the graph. This will enable you to get access to the raw media stream using the sample grabber's ISampleGrabber interface. Once you have the samples you can do what you like with them.
Use IMediaSample::GetPointer to retrieve a pointer to the buffer's raw data.