Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5972527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:40:13+00:00 2026-05-22T20:40:13+00:00

I have developed a small program using C# and bird.dll , but the birdRS232WakeUp()

  • 0

I have developed a small program using C# and bird.dll, but the birdRS232WakeUp() function seem not to be working.

When I call the birdRS232WakeUp() function in C++ the program will stop for a while (8-10 seconds). It looks like it is beginning to do the process connecting with the hardware (Flock of bird).

But in C#, it does not stop when calling birdRS232WakeUp(). How do I fix this problem?

The C# code is like the following.

[DllImport(@"Bird.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool birdRS232WakeUp(int nGroupID, Boolean  bStandAlone, int nNumDevices,
                                          ref ushort[] pwComport, uint dwBaudRate,
                                          uint dwReadTimeout, uint dwWriteTimeout);

ushort[] COM_port = new ushort[]{0,16,0,0,0};
if ((!birdRS232WakeUp(GROUP_ID, false, DEVCOUNT, ref COM_port, BAUD_RATE, READ_TIMEOUT, WRITE_TIMEOUT)))
{
    LWakeUpStatus.Text = "Failde to wake up FOB";
}

And the C++ code is looking like the following.

WORD COM_port[5] = {0,15,0,0,0}

if ((!birdRS232WakeUp(GROUP_ID,
    FALSE, // Not stand-alone
    DEVCOUNT, // Number of Devices
    COM_port, // COM Port
    BAUD_RATE, // BAUD
    READ_TIMEOUT,WRITE_TIMEOUT, // Reponses timeouts
    GMS_GROUP_MODE_ALWAYS)))
{
    printf("Can't Wake Up Flock!\n");
    Sleep(3000);
    exit(-1);}

C++ header file for this function:

birdRS232WakeUp(int nGroupID, BOOL bStandAlone, int nNumDevices,
                WORD *pwComport, DWORD dwBaudRate, DWORD dwReadTimeout,
                DWORD dwWriteTimeout, int nGroupMode = GMS_GROUP_MODE_ALWAYS);

And the manual states that “pwComport” points to an array of words, each of which is the number of the COM port attached to one of the birds (for example, COM1 = 1, COM2 = 2, etc.)

Update 1:

I have taken a suggestion from elder_george, but the problem still exist. I had to change the C# code to the following.

public  static extern bool birdRS232WakeUp(int nGroupID, Boolean  bStandAlone, int nNumDevices,
                           ushort[] pwComport, uint dwBaudRate, uint dwReadTimeout,
                           uint dwWriteTimeout,int nGroupMode);

if ((!birdRS232WakeUp(GROUP_ID, false, DEVCOUNT, COM_port, BAUD_RATE, READ_TIMEOUT, WRITE_TIMEOUT,2)))
{
    LWakeUpStatus.Text = "Failde to wake up FOB";
}

BTW, the int nGroupMode is equal to 2, based on the enum type below .

enum GroupModeSettings
{
    //    GMS_DEFAULT,         // Driver will determine whether or not to use RS232 group mode.
    GMS_GROUP_MODE_NEVER,      // RS232 group mode will never be used
    GMS_GROUP_MODE_ALWAYS,     // RS232 group mode will always be used
    NUM_GROUP_MODE_SETTINGS
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:40:14+00:00Added an answer on May 22, 2026 at 8:40 pm

    Not sure if these points will solve your problem, but:

    1) pwComport should be declared as ushort[] pwComport, not ref ushort[] pwComport

    2) you need to pass nGroupMode parameter from C#. You can set it to default value if you use C#4, but don’t ignore it at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have developed a small application and was working fine on developing machine but
I have developed a small application using Perl/Tk. The application will fetch data from
I have a small website developed using VS2005 and mySQl, it's just 2 webforms
I have developed a small desktop application in c#(using windows forms). For this project
I have developed a small server that recives connections (using basically the example here:
I have developed a small application and now i want to protect it. I
We have developed a small web application for a client. We decided on the
I have developed a small download system in PHP, where files are downloaded through
Hey guys, I have developed a small site that i would like to embed
We have a small 3 developer team that is currently using Subversion for our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.