Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi , I have a function inside a windows service in visual studio 2017 that captures alarms from a security camera, when I want to get an IP from the camera it returns a number "48" which is the sum of the numbers of IP 192.168.xx.xx, but I need not that number but the IP in a char [16] , some data that I need to change the code ?, I only get a number 48 in the position m_storeDev [0],functions get data from the cameras with communication SDK  C++ 


cDeviceIP[0] = 48 (it is the sum of the numbers of IP 192.168.xx.xx)
cDeviceIP[1] = 0
cDeviceIP[2] = 0
cDeviceIP[3] = 0
cDeviceIP[4] = 0
cDeviceIP[5] = 0
cDeviceIP[6] = 0
cDeviceIP[7] = 0
cDeviceIP[8] = 0
cDeviceIP[9] = 0
cDeviceIP[10] = 0
cDeviceIP[11] = 0
cDeviceIP[12] = 0
cDeviceIP[13] = 0
cDeviceIP[14] = 0
cDeviceIP[15] = 0

I need to have the IP numbers in each position of the array m_storeDev[16]


What I have tried:

Declation struct (NVSSDK.dll)
[StructLayout(LayoutKind.Sequential)]
    public struct PNVS_NFS_DEV
    {
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public Char[] cDeviceIP;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 250)]
        public Char[] cStorePath;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public Char[] cUsername;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public Char[] cPassword;
        public int iState;
    };


Call from Windows Service
PNVS_NFS_DEV m_storeDev;
int iRetx1 = NVSSDK.NetClient_NetFileGetMapStoreDevice(_ulLogonID, ref m_storeDev);
Posted
Updated 7-Sep-17 7:08am

1 solution

A lot of ip-camera's and equipment these days support the ONVIF protocol, you could try using an ONVIF routine or application, see:
GitHub - ozekiltd/Onvif-IP-Camera-Viewer[^]
C# Camera SDK: How to implement an Onvif IP Camera Manager in C#[^]
If that does not work you could try a sniffer like WireShark (complicated) or Fiddler.
If you are interested in connection strings, here is an extensive list from the open-source iSpy video application: Connecting iSpy to IP Cameras[^]
Also let us know what brand of ip-camera you have, maybe we can offer more help.
 
Share this answer
 
v2
Comments
Preatorian (RightCom) 8-Sep-17 10:25am    
Thank , I have been watching the Ozeki SKD right now, I will try to get the IP of the alarm without having to enter the IP in those Functions since I need to get the IP of the camera device that sends the alarm, just the camera sends an alarm VCA I need get the IP of which camera sends the alarm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900