Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4998433imm; Tue, 19 Jun 2018 03:25:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwWhgPr/gmWuTT9KpOJ7vLxUNvJDVF2+gRIKm8ccPmsDQNNrGqF6zYTQwpQ4fWpf1fTd6P X-Received: by 2002:a62:234a:: with SMTP id j71-v6mr17097646pfj.221.1529403944624; Tue, 19 Jun 2018 03:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529403944; cv=none; d=google.com; s=arc-20160816; b=fmsu4U8xmfeFL1WgekT8d6jU6GGSSS6Evc3xdvrKUNCMCgBm5YRdY4L/ER9fNiDXO7 c9ted9ZOvDB73Mg8au61YMRkqeWUptc5DQGUgYkLnxKixAyoRSSuZJpWVRZh2A8CcSSB zV5lHBmwkN1OXylUJHoG2O51YNY/xQajKejEPYviQcyMnoSvEvo6j9Zncku6idIB/37Y BQloWuuKS8T4DfvPGB1BsJ1tHP4T+MTJm6Pye7UoQPStcxML/UlxLvfLC6CZshdr/agu MU9GGXRHEwhkAqC/BHJ/yUJk/CcJijXyj2zzfEpMG4CoXreUWAjVNBeJWodYOZYpHvjF 45GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:autocrypt:openpgp:from :references:cc:to:subject:arc-authentication-results; bh=V3JzWF0YgtUIL130eHkEd6lEDfuheiMDArhvDAEAXNM=; b=vUVS5o4HyFSYyG+7EDAaDZCqXx7gc3c7dim0dGK9RZ3IGjJ0qemBPxTatBds2akmCB X2KdOmHgNw/ykSLvBo2UI7F91R4SsfSZvaRq1Uc38MvtJBdm5D6xFDh6O2mEDrVnioSg Ti18WTE0z4QCpCpsIglBXGQ+kUTCST5JwSbp181m5HGLCemeBJwIIOG3veWac9sj2uOq Mh1txnjAb4h/FYbAI/d2id1fTFO5xismmefQhbKD0YEmsxtSfjFjN9Yw3USC1xbeGro8 TYhfecKXjfD39p+IA68PrGBhFA13rkDiB2QCY40Dx81U4TFDu12/RDDmccMz1TWoAvHN ogIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si13761865pgn.178.2018.06.19.03.25.30; Tue, 19 Jun 2018 03:25:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757016AbeFSKYs (ORCPT + 99 others); Tue, 19 Jun 2018 06:24:48 -0400 Received: from dd39320.kasserver.com ([85.13.155.146]:55542 "EHLO dd39320.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756382AbeFSKYm (ORCPT ); Tue, 19 Jun 2018 06:24:42 -0400 X-Greylist: delayed 324 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Jun 2018 06:24:42 EDT Received: from [192.168.0.65] (x4db530c9.dyn.telefonica.de [77.181.48.201]) by dd39320.kasserver.com (Postfix) with ESMTPSA id 9BB022CE015E; Tue, 19 Jun 2018 12:19:16 +0200 (CEST) Subject: Re: rf69_set_deviation in rf69.c (pi433 driver) To: Hugo Lefeuvre Cc: Valentin Vidic , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman References: <20180605031120.GB1981@hle-laptop.local> From: Marcus Wolf Openpgp: preference=signencrypt Autocrypt: addr=marcus.wolf@smarthome-wolf.de; prefer-enc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Lq7V5cqzIf 5fcxtxIuFz1AG4gTnIysYvTmJZzoKHWBpJ8SKp42w9Ir/L8iiB9ae/G+UubDMacjDagzwTds w+1vR7t9T39uV/+KOpZfqbwZx7Wc2trr2k7L+puBJght8xUTBlafa/EzABEBAAHCwGUEGAEI AA8FAln0gUACGwwFCQPCSPAACgkQsXtxmq7XNr+IIQf/Q6H5zTJNrq12vPMRZbXWS+1gytGM jDgD7AbJy2tr5C0X/kpcxHrohwLvL8I2xCt3rXB28nQMwT1FJJ8zCoHTVDMX921KKVaqGN1D SxP3yQULbrcUYXlp2+iBAVzFQETjWaLbS0zYif7UMIZ54x0pGw/0pspEYLhjnykgnjFjPoMr 79JhTMgKFwzOuINRGSHtHw8KIrfPymr2DrpGAXuIAXdjrel7nTVC6D+hVf7/qvFSgNS1sHky RNbd3S3GhFBT1zypnMRro+o4Qke5huxQ4mTLbFveo3f3T+u602PYbv4pz9tLwTPBKaKtJBNX kqgUYrGFKWlJJbaXegzkY9WmWg== Message-ID: <50c4e6ee-e5fb-1d27-4e73-1e82080036b3@smarthome-wolf.de> Date: Tue, 19 Jun 2018 12:19:14 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180605031120.GB1981@hle-laptop.local> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hugo, sorry for the late response and thank you for all that deep investigation in the pi433 driver! > According to the datasheet[0], the deviation should always be smaller > than 300kHz, and the following equation should be respected: > > (1) FDA + BRF/2 =< 500 kHz > > Why did you choose 500kHz as max for FDA, instead of 300kHz ? It looks like > a bug to me. My focus was always on OOK and ASK. PSK was only used for a few measurements in the laboratory, I engaged to check CE compliance. Most probably 500kHz was a value, that's common for PSK and I didn't pay any attention to the datasheet. So I think, you are right: This is a bug and could be revised. Never the less: While using it in the lab, the transmission was fine and the signals over air have been clean and fitted to the recommondations of the CE. > > Concerning the TODO, I can see two solutions currently: > > 1. Introduce a new rf69_get_bit_rate function which reads REG_BITRATE_MSB > and REG_BITRATE_LSB and returns reconstructed BRF. > We could use this function in rf69_set_deviation to retrieve the BRF. > > + clean > + intuitive > - heavy / slow Why not: I like clean and intuitive implementations. Since it's used during configuration, we shouldn't be that squeezed in time, that we need to hurry. > > 2. Store BRF somewhere in rf69.c, initialize it with the default value > (4.8 kb/s) and update it when rf69_set_bit_rate is called. > > + easy > - dirty, doesn't fit well with the design of rf69.c (do not store > anything, simply expose API) Up to my experience, storing reg values is always a bit problematic, since the value may be outdated. And if you update the value every time you want to use it to be sure, it's correct, there is no win in having the copy of the reg value. So this wouldn't be my favourite. > > I'd really prefer going for the first one, but I wanted to have your opinion > on this. Agree. > Thanks for your work ! Your welcome :-) Marcus