android Bluetoothchat와 Atmega128 BT(HC-06) 통신시 이슈 by 설악이



안드로이드 예제 블루투스 채팅에서  Phone에서 나가는 데이터는 잘 받아지나.
ATmega128에서 오는 데이터는 자꾸 첫번째 바이트 읽고 나머지 바이트를 읽는 이슈가 있어서..
BluetoothChatService.java에서 아래와 같이 수정하였음.

이렇게 되면 문제 되는 부분은 해결이 된다. ㅋㅋㅋ 좋구나~~

 public void run() {
            Log.i(TAG, "BEGIN mConnectedThread");
            byte[] buffer = new byte[1024];
            int bytes;

            int check_bytes = 0;
            byte[] buffer_b = new byte[1024];
            
            // Keep listening to the InputStream while connected
            while (true) {
                try {
                    // Read from the InputStream
                    bytes = mmInStream.read(buffer);
                    if(bytes == 1)
                    {
                    //buffer_b 에 buffer 를 1byte copy
                        System.arraycopy(buffer, 0, buffer_b, 0, 1);
                    check_bytes = 1;
                    }
                    else
                    {
                    if(check_bytes==1)
                    {
                    //buffer_b에 buffer를 붙이고 bytes+1 해서 보냄
                    System.arraycopy(buffer, 0, buffer_b, 1, bytes); 
                            mHandler.obtainMessage(Sensor_mode.MESSAGE_READ, bytes+1, -1, buffer_b)
                            .sendToTarget();
                    check_bytes=0;
                   
                    }else
                    {
                    // Send the obtained bytes to the UI Activity
                            mHandler.obtainMessage(Sensor_mode.MESSAGE_READ, bytes, -1, buffer)
                                    .sendToTarget();                    
                    }
                    }
                } catch (IOException e) {
                    Log.e(TAG, "disconnected", e);
                    connectionLost();
                    break;
                }
            }
        }

덧글

  • Michael 2019/05/19 19:17 # 삭제 답글

    whoah this weblog is wonderful i really like studying your posts. Keep up the great paintings! You already know, lots of individuals are searching around for this information, you can help them greatly.
  • James 2019/05/20 19:49 # 삭제 답글

    I feel that is among the so much significant information for me. And i'm glad studying your article. However should observation on few general issues, The website taste is ideal, the articles is in point of fact excellent D. Just right activity, cheers
  • Richard 2019/05/21 13:47 # 삭제 답글

    There is visibly a bundle to realize about this. I assume you made certain nice points in features also.
  • George 2019/05/22 21:18 # 삭제 답글

    Thank you, I have just been searching for info about this subject for a long time and yours is the greatest I've found out so far. However, what about the bottom line? Are you positive concerning the supply?
  • David 2019/05/23 01:01 # 삭제 답글

    Hi there! I could have sworn I've been to this blog before but after checking through some of the post I realized it's new to me. Nonetheless, I'm definitely happy I found it and I'll be bookmarking and checking back frequently!
  • James 2019/05/24 06:08 # 삭제 답글

    Today, I went to the beach front with my kids.
  • Daniel 2019/05/24 15:27 # 삭제 답글

    Wow, superb blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is wonderful, let alone the content!
  • John 2019/05/26 13:54 # 삭제 답글

    Thank you for every other informative blog. The place else may just I get that type of info written in such a perfect means? I've a project that I'm just now working on, and I have been at the glance out for such information.
  • John 2019/05/28 20:28 # 삭제 답글

    Helpful info. Fortunate me I found your website by chance, and I'm shocked why this twist of fate did not took place earlier! I bookmarked it.
  • Michael 2019/05/29 15:21 # 삭제 답글

    You are my breathing in, I possess few blogs and very sporadically run out from to brand.
  • Robert 2019/05/31 12:16 # 삭제 답글

    I really appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thx again!
  • Mark 2019/06/01 09:29 # 삭제 답글

    It'll also save a lot of cash and time for those on
  • John 2019/06/01 12:48 # 삭제 답글

    reverse lookup cell phone free Your positions constantly have a decent amount of really
  • Joseph 2019/06/02 21:46 # 삭제 답글

    I just ought to tell you which you have written an exceptional and distinctive post that I really enjoyed reading. Im fascinated by how nicely you laid out your material and presented your views. Thank you.
  • George 2019/06/03 11:42 # 삭제 답글

    Fantastic website. A lot of useful information here. I'm sending it to a few pals ans also sharing in delicious. And naturally, thank you in your sweat!
  • James 2019/06/04 11:21 # 삭제 답글

    Today, while I was at work, my sister stole my apple ipad and tested to see if it can survive a 30 foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is entirely off topic but I had to share it with someone!
  • Thomas 2019/06/04 14:01 # 삭제 답글

    This is one awesome blog post. Keep writing.
  • Robert 2019/06/05 03:58 # 삭제 답글

    very nice submit, i definitely love this website, keep on it
  • George 2019/06/05 08:11 # 삭제 답글

    you're truly a just right webmaster. The site loading speed is incredible. It kind of feels that you are doing any distinctive trick. In addition, The contents are masterpiece. you've performed a magnificent task in this subject!
  • Donald 2019/06/06 08:27 # 삭제 답글

    very nice post, i certainly love this web site, keep on it
  • Mark 2019/06/09 06:35 # 삭제 답글

    This actually answered my drawback, thank you!
  • Charles 2019/06/09 20:40 # 삭제 답글

    Thanks again for the blog post.Thanks Again. Cool.
  • Joseph 2019/06/12 08:31 # 삭제 답글

    You're so interesting! I don't think I have read anything like this before. So wonderful to discover somebody with some unique thoughts on this subject matter. Seriously.. thank you for starting this up. This website is one thing that is needed on the internet, someone with a bit of originality!
  • Michael 2019/06/12 17:28 # 삭제 답글

    very nice post, i certainly love this web site, keep on it
  • Mark 2019/06/13 04:22 # 삭제 답글

    Your style is really unique compared to other folks I've read stuff from.
  • George 2019/06/16 10:05 # 삭제 답글

    Outstanding post, I conceive people should acquire a lot from this web blog its rattling user genial. So much superb info on here
  • Richard 2019/06/18 22:51 # 삭제 답글

    Wow, awesome blog layout! How long have you been blogging
  • Charles 2019/06/19 06:28 # 삭제 답글

    I'm really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, its rare to see a great blog like this one these days..
  • William 2019/06/19 14:12 # 삭제 답글

    As a Newbie, I am continuously searching online for articles that can aid me. Thank you
  • John 2019/06/20 04:13 # 삭제 답글

    I am really enjoying the themedesign of your blog. Do you ever run into any browser compatibility problems? A handful of my blog readers have complained about my website not operating correctly in Explorer but looks great in Chrome. Do you have any advice to help fix this issue?
  • John 2019/06/22 05:48 # 삭제 답글

    Hey very nice site!! Man .. Beautiful .. Amazing .. I will bookmark your blog and take the feeds alsoI am happy to find a lot of useful info here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .
  • John 2019/06/24 23:19 # 삭제 답글

    Some truly select blog posts on this web site , saved to fav.
  • Robert 2019/06/25 04:37 # 삭제 답글

    Thanks so much for the article.Much thanks again. Great.
  • Richard 2019/06/26 10:18 # 삭제 답글

    I think you have observed some very interesting details , appreciate it for the post.
  • Mark 2019/06/26 22:21 # 삭제 답글

    Hey are using WordPress for your blog platform? I'm new to the blog world but I'm trying to get started and set up my own. Do you require any coding knowledge to make your own blog? Any help would be really appreciated!
  • Richard 2019/06/27 05:57 # 삭제 답글

    Article Source a viral game app is not
  • David 2019/06/29 19:49 # 삭제 답글

    I like what you guys are up too. This kind of clever work and exposure!
  • Daniel 2019/06/29 21:24 # 삭제 답글

    Excellently written writeup, doubts all bloggers offered the same content material because you, the internet is actually a greater location. Please maintain it up!
  • Donald 2019/06/30 00:46 # 삭제 답글

    Im not that much of a online reader to be honest but your blogs really nice, keep it up! I'll go ahead and bookmark your site to come back later. Cheers
  • David 2019/07/05 10:17 # 삭제 답글

    hi!,I really like your writing so so much! proportion we communicate more about your post on AOL? I need a specialist on this space to unravel my problem. Maybe that's you! Looking ahead to see you.
  • Mark 2019/07/06 17:46 # 삭제 답글

    I like what you guys are up too. Such clever work and reporting! Carry on the excellent works guys I have incorporated you guys to my blogroll. I think it will improve the value of my website
  • George 2019/07/09 10:34 # 삭제 답글

    weblog. Loads of gratitude sharing.
  • Donald 2019/07/11 00:14 # 삭제 답글

    1000s of Show Gambler, since the Lastly associated with Sept ..
  • Donald 2019/07/11 13:06 # 삭제 답글

    1 Program you'r planting of crops to coincide whenever you can log onto your farm to reap them.
  • Joseph 2019/07/12 02:08 # 삭제 답글

    Do you agree with my statement that this post is awesome?
  • John 2019/07/12 19:18 # 삭제 답글

    plus offering extras which can announce this kind of the main benefit of the skepticism.
  • Mark 2019/07/14 05:42 # 삭제 답글

    Good post. I study something more challenging on completely different blogs everyday. It is going to all the time be stimulating to learn content material from different writers and practice somewhat one thing from their store. I
  • Michael 2019/07/14 11:58 # 삭제 답글

    Hey! Do you know if they make any plugins to help with Search Engine Optimization? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains. If you know of any please share. Many thanks!
  • Mark 2019/07/14 19:15 # 삭제 답글

    This event occurred rigt after the time Mario return to the Mushroom Kingdom so it had to take place after
  • William 2019/07/15 05:44 # 삭제 답글

    Heya i am for the first time here. I found this board and I find It really useful &amp it helped me out much. I hope to give something back and aid others like you helped me.
  • Thomas 2019/07/16 15:14 # 삭제 답글

    A megapolis megabucks gratuit failed to seem to cause waste materials in addition
  • David 2019/07/18 05:06 # 삭제 답글

    I just couldn't go away your web site before suggesting that I really enjoyed the usual information an individual provide on your visitors? Is gonna be again continuously in order to check up on new posts
  • George 2019/07/19 16:53 # 삭제 답글

    I really like your writing style, good information, thankyou for posting D.
  • William 2019/07/19 22:50 # 삭제 답글

    obviously like your website however you need to check the spelling on several of your posts. Several of them are rife with spelling issues and I to find it very bothersome to tell the truth on the other hand I will definitely come again again.
  • Thomas 2019/07/20 00:28 # 삭제 답글

    Nice read, I just passed this onto a friend who was doing some research on that. And he just bought me lunch since I found it for him smile So let me rephrase that Thank you for lunch! Whenever you have an efficient government you have a dictatorship. by Harry S Truman.
  • Donald 2019/07/20 01:50 # 삭제 답글

    Thanks for this article. I'd also like to convey that it can always be hard if you find yourself in school and starting out to initiate a long history of credit. There are many college students who are only trying to live and have long or good credit history can often be a difficult thing to have.
  • Daniel 2019/07/20 04:07 # 삭제 답글

    Hi. Only wanted to ask a quick issue. Now i am
  • William 2019/07/22 10:22 # 삭제 답글

    I like what you guys are up too. This kind of clever work and exposure!
  • Joseph 2019/07/22 16:07 # 삭제 답글

    Android Game Development takes more than knowledge
  • Thomas 2019/07/23 13:27 # 삭제 답글

    Have you ever considered about including
  • Charles 2019/07/24 21:22 # 삭제 답글

    Inspiring story, where did you quote it from?
  • Mark 2019/07/26 00:35 # 삭제 답글

    I'm really enjoying the design and layout of your website. It's a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your theme? Excellent work!
  • Paul 2019/07/31 06:54 # 삭제 답글

    Howdy very nice web site!! Guy .. Excellent .. Superb .. I'll bookmark your web site and take the feeds additionallyI am glad to search out so many helpful info here in the put up, we want develop more techniques in this regard, thanks for sharing.
  • James 2019/07/31 21:33 # 삭제 답글

    I think you have observed some very interesting details , appreciate it for the post.
  • Donald 2019/08/01 14:09 # 삭제 답글

    I really enjoy the blog post. Great.
  • Paul 2019/08/02 03:18 # 삭제 답글

    Hi, Neat post. There is a problem with your web site in internet explorer, would check this IE still is the market leader and a large portion of people will miss your magnificent writing because of this problem.
  • Charles 2019/08/02 04:39 # 삭제 답글

    I am truly thankful to the holder of this website who has shared this fantastic article at here.
  • Michael 2019/08/03 23:51 # 삭제 답글

    Thanks again for the blog post.Thanks Again. Cool.
  • Thomas 2019/08/04 01:24 # 삭제 답글

    free cell phone number lookup by name You can certainly see your
  • Richard 2019/08/04 09:41 # 삭제 답글

    Usually I do not read writeup on blogs, nevertheless I wish to say that this writeup extremely forced me to take a look at and do so! Your writing taste has been amazed me. Thanks, really wonderful post.
  • Donald 2019/08/04 13:52 # 삭제 답글

    I keep listening to the news update lecture about receiving boundless online grant applications so I have been looking around for the top site to get one. Could you advise me please, where could i acquire some?
  • David 2019/08/05 15:04 # 삭제 답글

    I am no longer sure the place you're getting your info, but great topic. I needs to spend a while studying much more or understanding more. Thanks for wonderful info I was on the lookout for this info for my mission.
  • Richard 2019/08/09 05:56 # 삭제 답글

    Very interesting subject , appreciate it for posting . All human beings should try to learn before they die what they are running from, and to, and why. by James Thurber.
  • James 2019/08/10 23:04 # 삭제 답글

    You are my breathing in, I possess few blogs and very sporadically run out from to brand.
  • Michael 2019/08/11 01:46 # 삭제 답글

    omg! cant picture how quick time pass, after August, ber months time already and Setempber may be the 1st Christmas season in my location, I genuinely really like it!
  • Donald 2019/08/11 09:50 # 삭제 답글

    Hi to all, how is everything, I think every one is getting more from this site, and your views
  • George 2019/08/11 10:27 # 삭제 답글

    Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a little bit, but other than that, this is great blog. An excellent read. I will certainly be back.
  • James 2019/08/11 11:31 # 삭제 답글

    You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and extremely broad for me. I'm looking forward for your next post, I'll try to get the hang of it!
  • Joseph 2019/08/11 13:54 # 삭제 답글

    Spot lets start off perform on this writeup, I seriously consider this astounding internet site needs much more consideration. Ill apt to become once again to find out to read considerably a lot more, thank you that information.
  • Thomas 2019/08/15 01:59 # 삭제 답글

    Over the course of the initial period, they began to flrm group identities.
  • Michael 2019/08/15 02:03 # 삭제 답글

    reverse phone lookup free results I am no longer positive
  • Charles 2019/08/15 13:50 # 삭제 답글

    I feel like Im regularly seeking interesting features you just read about a number of subjects, but I handle to add in the blog among our translates every day when you
  • Joseph 2019/08/15 14:52 # 삭제 답글

    Hiya, I am really glad I have found this information. Nowadays bloggers publish just about gossips and web and this is really annoying. A good blog with interesting content, that is what I need. Thanks for keeping this website, I'll be visiting it. Do you do newsletters? Can not find it.
  • David 2019/08/16 20:28 # 삭제 답글

    Thank you, I have just been searching for info about this subject for a long time and yours is the greatest I've found out so far. However, what about the bottom line? Are you positive concerning the supply?
  • Mark 2019/08/18 19:02 # 삭제 답글

    Low cost Gucci Handbags Is generally blogengine much much better than wp for reasons unknown? Should be which is turning out to be popluar today.
  • Daniel 2019/08/19 07:58 # 삭제 답글

    This design is incredible! You obviously know how to keep a reader amused.
  • Joseph 2019/08/21 16:41 # 삭제 답글

    Normally I do not read post on blogs, but I wish to say that this writeup very compelled me to try and do it! Your writing style has been surprised me. Thanks, quite great article.
  • Robert 2019/08/22 21:24 # 삭제 답글

    Im genuinely enjoying the style and layout of one's website. Its a very uncomplicated on the eyes which makes it a great deal much more enjoyable for me to come here and pay a visit to far more typically. Did you hire out a designer to make your theme? Excellent perform!
  • Paul 2019/08/23 07:06 # 삭제 답글

    You have brought up a very good details , thankyou for the post.
  • Richard 2019/08/25 12:06 # 삭제 답글

    Very efficiently written post. It will be valuable to anyone who usess it, as well as myself. Keep doing what you are doing i will definitely read more posts.
  • Daniel 2019/08/25 22:04 # 삭제 답글

    Wow! This blog looks exactly like my old one! It's on a completely different topic but it has pretty much the same page layout and design. Excellent choice of colors!
  • Thomas 2019/08/27 14:21 # 삭제 답글

    I am not sure where you are getting your info, but great topic. I needs to spend some time learning much more or understanding more. Thanks for fantastic information I was looking for this info for my mission.
  • Daniel 2019/08/29 16:05 # 삭제 답글

    Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! By the way, how could we communicate?
  • Donald 2019/09/01 23:34 # 삭제 답글

    Your weblog is 1 of a kind, i really like the way you organize the topics.
  • Richard 2019/09/02 10:34 # 삭제 답글

    If you are going for best contents like myself, just pay a quick visit this web page everyday since it offers feature contents, thanks
  • Daniel 2019/09/06 12:13 # 삭제 답글

    Wow, superb blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your website is wonderful, let alone the content!
  • William 2019/09/07 03:27 # 삭제 답글

    Say, you got a nice blog post. Really Cool.
  • John 2019/09/08 14:57 # 삭제 답글

    This kind of game gives a real experience of building a
  • Daniel 2019/09/10 08:02 # 삭제 답글

    whoah this weblog is wonderful i love studying your posts. Stay up the great work! You know, many individuals are searching round for this info, you can aid them greatly.
  • Robert 2019/09/13 09:20 # 삭제 답글

    I needed to thank you for this good read!! I certainly enjoyed every little bit of it. I've got you bookmarked to check out new stuff you post
댓글 입력 영역
◀ 다음덧글    이전덧글 ▶