How do I convert UInt16[] to IntPtr

vinodkumarvinodkumar INMember ✭✭

Hi

How do I convert to UInt16[] to IntPtr

UInt16[] intermec = new UInt16[] 
   {
                                        0x41,           // Start allscripts running config
                                        0x56, 0x40, 1,  //enable gs1 composite a/b
                                        0x56, 0x41, 1,  //enable gs1 composite c
                                        0x56, 0x44, 1   //enable ga1 composite linear transmit
                                        };                                     
Tagged:

Posts

  • kentuckerkentucker USMember ✭✭✭✭✭

    An IntPtr is a platform-specific type that is used to represent a pointer or a handle. I really do not understanding what you are trying to accomplish here.

  • vinodkumarvinodkumar INMember ✭✭

    @kentucker , Thank you for your response, I had implemented IPC barcode scanner in Xamarin.iOS and I need to configure special symbols to scan, below is the code to configure the different symbols for IPC(LineaPro sdk) barcode scanner.

            byte[] intermec = new byte[]
                                        {
                                        0x41,           // Start allscripts running config
                                        0x56, 0x40, 1,  //enable gs1 composite a/b
                                        0x56, 0x41, 1,  //enable gs1 composite c
                                        0x56, 0x44, 1   //enable ga1 composite linear transmit
                                        }; 
                    IntPtr pointer = Marshal.AllocHGlobal(intermec.Length);
                    Marshal.Copy(intermec, 0, pointer, intermec.Length);
    
                    NSData data = new NSData(pointer, (nuint)intermec.Length, DeallocatePinnedArray);
                    lineaDevice.BarcodeIntermecSetInitData(data, out error); 
                    if (error != null)
                    { 
                        return error;
                    }
    
Sign In or Register to comment.