Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

i have a .so file.I want value of API(c++) int RFIDAuthenCard(char nBlock, char keyType, char* key);

$
0
0

namespace embeded_test
{

public class embeded_test
{

    [DllImport("libszxb.so")]
    public static extern int RFIDAuthenCard(int nBlock,string keyType,[In,Out] string[] key); 

}

public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
    }

    private void Button_Clicked(object sender, EventArgs e)
    {   
        string[] array1 = new string[6];
        Console.WriteLine("Integer array passed ByVal before call:");
        for (int i1 = 0; i1 < array1.Length; i1++)
        {
            array1[i1] = "0xff";

        }

        StringBuilder nBlock =new StringBuilder("0");
        string keytype = "0x0a";     
        int l = embeded_test.RFIDAuthenCard(0,keytype,array1); 
    }
}

}

it returns 255 which is a failure value and application will crash.
other API like int printerdata(char *data); is working properly.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>