Skip to content

Update IPRange.ts#94

Merged
dadepo merged 2 commits intoip-num:masterfrom
dwarburt:range-overlaps-self
Apr 19, 2023
Merged

Update IPRange.ts#94
dadepo merged 2 commits intoip-num:masterfrom
dwarburt:range-overlaps-self

Conversation

@dwarburt
Copy link
Contributor

Address #93

@dadepo
Copy link
Member

dadepo commented Apr 18, 2023

@dwarburt Thanks for the PR. Can you also help a test for this scenario?

@dadepo dadepo closed this Apr 19, 2023
@dadepo dadepo reopened this Apr 19, 2023
@dadepo dadepo merged commit cf047cf into ip-num:master Apr 19, 2023
soleary080679 pushed a commit to soleary080679/ip-num that referenced this pull request May 7, 2024
Update IPRange.ts
Crsarmv7l patch 1 (#150)

* Fix bug

With the original bw = 1000.0*24 / (8.0*(4+chanbw_m) * pow(2,chanbw_e))

chanbw_m and chanbw_e both have a range from 0 to 3 inclusive, using those values you would get a bw of the following with 0 values resulting in the highest bw (division).

750.0
300.0
125.0
53.57142857142857

Given these bw values, the subsequent if statements will never be true. Additionally this same equation with a different (correct) multiplier for mhz is used in getMdmChanBW

* fix def calculateMdmDeviatn

old_div is doing something funky here.

When extracting and running just this function and printing deviatn, all baud that *should* fall in these are zero.

elif baud <= 38400:
    deviatn = 20000 * (old_div((baud-2400),36000))
else:
    deviatn = 129000 * (old_div((baud-38400),211600))

by changing it to normal division it returns much more reasonable results

* Fix calculatePktChanBW

The comments in this function state this:
''' calculates the optimal ChanBW setting for the current freq/baud
        * totally experimental *
        from Smart RF Studio:
        1.2 kbaud BW: 63khz
        2.4 kbaud BW: 63khz
        38.4kbaud BW: 94khz
        250 kbaud BW: 600khz
        '''
The 1.2kbaud listed 63khz, yet the table of possibles includes 53e3. Not that big a difference, but when passing 53e3 to setMdmChanBW, it always triggers an exception in that function.

Removing 53e3 from the table is in line with the comments and prevents triggering the exception in setMdmChanBW

* Update chipcon_nic.py
Initial Commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants