Getf binary API not working in C++ SDK

Hello All,

I am using the following code snippet to get a file from Cumulosity platform to a device (I am pushing a configuration binary from platform to device and this is the code snippet of handler of instruction handler to push the file - written on the agent side):

virtual void operator()(SrRecord &r, SrAgent &agent)
{
const string fToStore(“cfgFile.txt”);
SrNetBinHttp srBinObj(agent.server(),agent.auth());
srBinObj.getf(r.value(3),fToStore)
}

r.value(3) is value of c8y_DownloadConfigFile.url and has the form “https:///inventory/binaries/binaryID”.

Am consistently getting error 404 for resource not found for mentioned URL.

Any help is appreciated here. Thanking all in advance.

Thanks and Best Regards.

@veenit.vora, just a suggestion, you may want to look linux agent sample to get some help.
I assuming you are using C++ device SDK.

https://cumulocity.com/guides/device-sdk/cpp/

The following list presents the existing agent software implemented on the C++ SDK.

NetComm agent
Smartrest agent is an agent software implemented for NetComm NTC-6200 and NTC-140w routers, which is used in many production projects.

https://bitbucket.org/m2m/cumulocity-agents-netcomm

Linux agent
Linux agent is a reference agent implementation, which can be used on any devices that are powered by a generic Linux distribution, e.g., Ubuntu, Fedora, etc.

https://bitbucket.org/m2m/cumulocity-agents-linux

@Gyan_Awasthi1
Thank you for the reply.
Yes, I am using the C++ device SDK.
I have already had a look at Netcomm agent. My implementation is similar to what is implemented there. The only difference is that it is implemented in Lua there and I have C++ code.

Shall look at the reference Linux agent and get back in case of further queries.