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 7543675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:29:21+00:00 2026-05-30T08:29:21+00:00

I am currently working on a piece of python code integrated with c++ on

  • 0

I am currently working on a piece of python code integrated with c++ on an open source platform. Python classes and definitions pass arguments to c++ files and the function runs thereby. My c++ file is a packet_sink file which takes 3 input arguments that are mentioned below :

packet_sink (const std::vector<unsigned char>& sync_vector,
                                msg_queue_sptr target_queue, int threshold)

The partial piece of python code is as follows :

   self.threshold = -1
   if access_code is None:
       code = tuple(string_to_1_0_list(default_access_code))
       access_code = to_1_0_string(code)
   if not packet_utils.is_1_0_string(access_code):
       raise ValueError, "Invalid access_code %r. Must be string of 1's and 0's" % (access_code,)
   print " _access_code : %s " %(self._access_code,)

   self._msgq = gr.msg_queue()# holds packets fromthe PHY

   self.phy_anay_demod= phy_anay_demod(self,*args, **kwargs)
   self._packet_sink =gr.packet_sink(self._access_code,self._msgq,self.threshold)

The value of _access_code is:

0011010110111011001001010100011101001111001100010000010000111111

But the error message that i am receiving is as follows :

TypeError: in method ‘packet_sink’, argument 1 of type ‘std::vector< unsigned char,std::allocator< unsigned char > > const &’.

Could anybody please help me understand the error if not a resolution to the problem.

  • 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-30T08:29:22+00:00Added an answer on May 30, 2026 at 8:29 am

    It looks to me like self._access_code should be a list or tuple of integers which are either 0 or 1.

    Gnuradio uses SWIG to create the python interface from the C++ code. SWIG will map a C++ vector to a python list. So if you pass in a list of integers (0 or 1) this should happily be converted to vector.

    My guess is that your self._access_code is a string and you need to apply the function string_to_1_0_list to it.

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

Sidebar

Related Questions

I'm currently working in a piece of code where both logic and data access
I am currently working a piece of code which needs to send an attachment
I am currently working on the maintenance of a piece of code that is
I am currently working with a piece of code that has been written by
I'm currently working on a piece of code that quite simply uses a boolean
I'm currently working with a piece of code to detect whether a user has
In the code I am currently working on I came across a piece code
I am currently working on specifying a piece of software whereby generated emails will
I am currently working on a project that is accessing a piece of hardware
I`m currently working on a script, and I have the following situation. function somnicefunction()

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.