Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set centerFrequency >2GHz for some devices via API #624

Closed
srcejon opened this issue Sep 4, 2020 · 3 comments
Closed

Can't set centerFrequency >2GHz for some devices via API #624

srcejon opened this issue Sep 4, 2020 · 3 comments
Labels
Milestone

Comments

@srcejon
Copy link
Collaborator

srcejon commented Sep 4, 2020

For some devices it isn't possible to set the centerFrequency greater than 2GHz using the API.

For example, with the TestSource:

curl -X PATCH "http://127.0.0.1:8091/sdrangel/deviceset/0/device/settings" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "deviceHwType": "TestSource", "direction": 0, "testSourceSettings": { "centerFrequency": 2435000000 }}"

Results in the center frequency being set to 0.

Looking in swagger/sdrangel/code/qt5/client, it seems most targets use qint64 for center frequency, but TestSource and some others are just using a 32-bit signed integer, so will overflow.

@srcejon
Copy link
Collaborator Author

srcejon commented Sep 9, 2020

Just looking at how to rebuild the swagger generated files. In the swagger/sdrangel/readme.md, it refers to using a patched version of swagger-codegen:

https://github.com/etherealjoy/swagger-codegen/tree/qt5cpp_rework_antis81_patch-1

This branch doesn't seem to exist anymore. It appears to have been merged now: swagger-api/swagger-codegen#7194

It seems the existing generated files were generated using a version around 2.4.0 (according to swagger/sdrangel/code/qt5/.swagger-codegen/VERSION), however, I can't recreate the existing files using prebuilt versions of swagger (I've tried 2.4.0 to 2.4.15 - wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15/swagger-codegen-cli-2.4.15.jar).

In the SDRangel git repo, several methods are virtual which aren't in the regenerated files, SWG_API and export.h are missing and some method signatures have changed. Any idea what I might be missing? Thanks.

@f4exb
Copy link
Owner

f4exb commented Sep 10, 2020

@f4exb
Copy link
Owner

f4exb commented Sep 10, 2020

In TestSource.yaml:

TestSourceSettings:
  description: TestSource
  properties:
    centerFrequency:
      type: integer
      format: uint64

I suppose uint64 is not interpreted by the generator as a 64 bit unsigned. To keep the large integer format one must use int64 instead.

Edit: it looks like it is indeed the case.

@f4exb f4exb added the bug label Sep 10, 2020
@f4exb f4exb added this to the v4.15.5 milestone Sep 10, 2020
@f4exb f4exb closed this as completed in 308b870 Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants