[chirp_devel] Fixed Frequency Radio

Jim Unroe
Sun Aug 27 15:52:55 PDT 2017


> In a pinch, just raise an exception in your driver if the frequency is
> different than you expect during a set_memory() operation. Alternately,
> you could just ignore what mem.freq is set to entirely.

I am trying to do it as below...

class MyRadioFeatures(chirp_common.RadioFeatures):
    def validate_memory(self, mem):
        # Run the normal validation
        msgs = chirp_common.RadioFeatures.validate_memory(self, mem)

        # Run my validation
        if mem.number <= 6 and mem.mode != "NFM":
            msgs.append(chirp_common.ValidationError(
                        "Only NFM is supported on this channel"))

        #if mem.number >=0 and mem.number <= 14:
        #    if mem.duplex != "":
        #        msgs.append(chirp_common.ValidationError(
        #                    "Only '(None)' is supported on this channel"))
        if (mem.number >= 15 and mem.number <= 22):
            if mem.duplex != "+":
                msgs.append(chirp_common.ValidationError(
                            "Only '+' is supported on this channel"))
            if mem.offset != 5000000:
                msgs.append(chirp_common.ValidationError(
                            "Only '5.000000' is supported on this channel"))

        #if mem.number <= 22 and mem.freq != LIST_GMRS[mem.number]:
        #    msgs.append(chirp_common.ValidationError(
        #                "Editing this field is not supported on this channel"))

        return msgs

But if I uncomment either either of the commented code, then I get a
"Radio did not validate a valid memory" error when running the suite
of tests.

    BTECH GMRS-V1       Detect     ←[1;32m PASSED:←[0m All tests
    BTECH GMRS-V1       Settings   ←[1;32m PASSED:←[0m All tests
    BTECH GMRS-V1       Clone      ←[1;32m PASSED:←[0m All tests
    BTECH GMRS-V1       Edges      ←[1;32m PASSED:←[0m All tests
    BTECH GMRS-V1       BruteForce ←[1;41m FAILED:←[0m Radio did not
validate a valid memory
    BTECH GMRS-V1       CopyAll    ←[1;32m PASSED:←[0m All tests
    BTECH GMRS-V1       Banks      ←[1;32mSKIPPED:←[0m Banks not supported

Any tips on what I can do to resolve this? The code otherwise works as
I expect it to.

Thanks,
Jim KC9HI



More information about the chirp_devel mailing list