When you use a barcode scanner, it won't automatically send SMS. There is no free lunch here. You need to program that either by writing one from scratch (bad idea) or leveraging existing APIs and services, example Twilio.
Let's ignore for now the barcode scanner. Can you write a program that can send SMS by leveraging existing APIs or services? If you can't the barcode scanner is not your problem.